|
1 | | -""" pyplots.ai |
| 1 | +"""pyplots.ai |
2 | 2 | gantt-dependencies: Gantt Chart with Dependencies |
3 | 3 | Library: highcharts 1.10.3 | Python 3.14 |
4 | 4 | Quality: 89/100 | Updated: 2026-02-25 |
|
20 | 20 |
|
21 | 21 | # Chart configuration using Highcharts Gantt with parent/child grouping |
22 | 22 | # Software Development Project: 4 phases, 12 tasks + 2 milestones, finish-to-start dependencies |
| 23 | +# Critical path highlighted with bold red connectors; non-critical shown as light dashed lines |
23 | 24 | # Refined muted palette: slate blue, amber, muted purple, teal |
24 | 25 | chart_config = """ |
25 | 26 | Highcharts.ganttChart('container', { |
26 | 27 | chart: { |
27 | 28 | width: 4800, |
28 | | - height: 2700, |
| 29 | + height: 2550, |
29 | 30 | backgroundColor: '#FAFBFC', |
30 | 31 | spacingTop: 50, |
31 | | - spacingBottom: 50, |
| 32 | + spacingBottom: 40, |
32 | 33 | spacingLeft: 50, |
33 | 34 | spacingRight: 50, |
34 | 35 | style: { |
35 | 36 | fontFamily: '"Segoe UI", "Helvetica Neue", Arial, sans-serif' |
| 37 | + }, |
| 38 | + events: { |
| 39 | + load: function() { |
| 40 | + var ren = this.renderer; |
| 41 | + var x = this.plotLeft + this.plotWidth - 560; |
| 42 | + var y = this.plotTop + this.plotHeight + 10; |
| 43 | + // Critical path legend |
| 44 | + ren.path(['M', x, y, 'L', x + 55, y]) |
| 45 | + .attr({ 'stroke-width': 4, stroke: '#C0392B' }) |
| 46 | + .add(); |
| 47 | + ren.text('Critical Path', x + 68, y + 6) |
| 48 | + .css({ fontSize: '20px', color: '#5D6D7E', fontWeight: '600' }) |
| 49 | + .add(); |
| 50 | + // Non-critical legend |
| 51 | + ren.path(['M', x + 280, y, 'L', x + 335, y]) |
| 52 | + .attr({ 'stroke-width': 2, stroke: '#B0BEC5', 'stroke-dasharray': '6,4' }) |
| 53 | + .add(); |
| 54 | + ren.text('Non-Critical', x + 348, y + 6) |
| 55 | + .css({ fontSize: '20px', color: '#95A5A6', fontWeight: '400' }) |
| 56 | + .add(); |
| 57 | + } |
36 | 58 | } |
37 | 59 | }, |
38 | 60 | title: { |
|
106 | 128 | align: 'left', |
107 | 129 | padding: 12, |
108 | 130 | style: { |
109 | | - fontSize: '18px', |
| 131 | + fontSize: '22px', |
110 | 132 | fontWeight: '600', |
111 | | - textOutline: '2.5px #FAFBFC' |
| 133 | + textOutline: '3px #FAFBFC' |
112 | 134 | }, |
113 | 135 | format: '{point.name}', |
114 | 136 | overflow: 'allow', |
115 | 137 | crop: false |
116 | 138 | }, |
117 | 139 | connectors: { |
118 | | - lineWidth: 3, |
119 | | - dashStyle: 'Solid', |
120 | | - lineColor: '#5D6D7E', |
| 140 | + lineWidth: 2, |
| 141 | + dashStyle: 'ShortDash', |
| 142 | + lineColor: '#B0BEC5', |
121 | 143 | radius: 10, |
122 | 144 | startMarker: { |
123 | 145 | enabled: false |
|
126 | 148 | enabled: true, |
127 | 149 | width: 12, |
128 | 150 | height: 12, |
129 | | - color: '#5D6D7E' |
| 151 | + color: '#B0BEC5' |
130 | 152 | } |
131 | 153 | } |
132 | 154 | } |
133 | 155 | }, |
134 | 156 | series: [{ |
135 | 157 | name: 'Project Schedule', |
136 | 158 | data: [ |
137 | | - // Phase 1: Requirements (Jan 1 - Jan 20) — Slate Blue |
| 159 | + // Phase 1: Requirements (Jan 1 - Jan 22) — Slate Blue |
138 | 160 | { |
139 | 161 | id: 'requirements', |
140 | 162 | name: 'Requirements Phase', |
|
154 | 176 | parent: 'requirements', |
155 | 177 | start: Date.UTC(2024, 0, 11), |
156 | 178 | end: Date.UTC(2024, 0, 17), |
157 | | - dependency: 'req_gather', |
| 179 | + dependency: { to: 'req_gather', lineColor: '#C0392B', lineWidth: 4 }, |
158 | 180 | color: '#306998' |
159 | 181 | }, |
160 | 182 | { |
|
163 | 185 | parent: 'requirements', |
164 | 186 | start: Date.UTC(2024, 0, 18), |
165 | 187 | end: Date.UTC(2024, 0, 22), |
166 | | - dependency: 'req_analysis', |
| 188 | + dependency: { to: 'req_analysis', lineColor: '#C0392B', lineWidth: 4 }, |
167 | 189 | color: '#306998' |
168 | 190 | }, |
169 | 191 | // Milestone: Requirements Baseline |
|
173 | 195 | parent: 'requirements', |
174 | 196 | start: Date.UTC(2024, 0, 22), |
175 | 197 | milestone: true, |
176 | | - dependency: 'req_approval', |
| 198 | + dependency: { to: 'req_approval', lineColor: '#C0392B', lineWidth: 4 }, |
177 | 199 | color: '#1A3A5C' |
178 | 200 | }, |
179 | 201 | // Phase 2: Design (Jan 23 - Feb 9) — Amber |
|
188 | 210 | parent: 'design', |
189 | 211 | start: Date.UTC(2024, 0, 23), |
190 | 212 | end: Date.UTC(2024, 1, 2), |
191 | | - dependency: 'milestone_req', |
| 213 | + dependency: { to: 'milestone_req', lineColor: '#C0392B', lineWidth: 4 }, |
192 | 214 | color: '#D4920B' |
193 | 215 | }, |
194 | 216 | { |
|
197 | 219 | parent: 'design', |
198 | 220 | start: Date.UTC(2024, 0, 23), |
199 | 221 | end: Date.UTC(2024, 1, 5), |
200 | | - dependency: 'milestone_req', |
| 222 | + dependency: { to: 'milestone_req', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, |
201 | 223 | color: '#E8A817' |
202 | 224 | }, |
203 | 225 | { |
|
206 | 228 | parent: 'design', |
207 | 229 | start: Date.UTC(2024, 1, 3), |
208 | 230 | end: Date.UTC(2024, 1, 9), |
209 | | - dependency: 'design_arch', |
| 231 | + dependency: { to: 'design_arch', lineColor: '#C0392B', lineWidth: 4 }, |
210 | 232 | color: '#D4920B' |
211 | 233 | }, |
212 | | - // Phase 3: Development (Feb 10 - Mar 15) — Muted Purple |
| 234 | + // Phase 3: Development (Feb 7 - Mar 15) — Muted Purple |
213 | 235 | { |
214 | 236 | id: 'development', |
215 | 237 | name: 'Development Phase', |
|
221 | 243 | parent: 'development', |
222 | 244 | start: Date.UTC(2024, 1, 12), |
223 | 245 | end: Date.UTC(2024, 2, 4), |
224 | | - dependency: 'design_db', |
| 246 | + dependency: { to: 'design_db', lineColor: '#C0392B', lineWidth: 4 }, |
225 | 247 | color: '#7B5EA7' |
226 | 248 | }, |
227 | 249 | { |
|
230 | 252 | parent: 'development', |
231 | 253 | start: Date.UTC(2024, 1, 7), |
232 | 254 | end: Date.UTC(2024, 2, 1), |
233 | | - dependency: 'design_ui', |
| 255 | + dependency: { to: 'design_ui', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, |
234 | 256 | color: '#9B7EC8' |
235 | 257 | }, |
236 | 258 | { |
|
239 | 261 | parent: 'development', |
240 | 262 | start: Date.UTC(2024, 2, 5), |
241 | 263 | end: Date.UTC(2024, 2, 15), |
242 | | - dependency: ['dev_backend', 'dev_frontend'], |
| 264 | + dependency: [ |
| 265 | + { to: 'dev_backend', lineColor: '#C0392B', lineWidth: 4 }, |
| 266 | + { to: 'dev_frontend', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' } |
| 267 | + ], |
243 | 268 | color: '#7B5EA7' |
244 | 269 | }, |
245 | 270 | // Phase 4: Testing (Mar 5 - Mar 29) — Teal |
|
254 | 279 | parent: 'testing', |
255 | 280 | start: Date.UTC(2024, 2, 5), |
256 | 281 | end: Date.UTC(2024, 2, 15), |
257 | | - dependency: 'dev_backend', |
| 282 | + dependency: { to: 'dev_backend', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, |
258 | 283 | color: '#0F8B8D' |
259 | 284 | }, |
260 | 285 | { |
|
263 | 288 | parent: 'testing', |
264 | 289 | start: Date.UTC(2024, 2, 16), |
265 | 290 | end: Date.UTC(2024, 2, 22), |
266 | | - dependency: ['dev_integration', 'test_unit'], |
| 291 | + dependency: [ |
| 292 | + { to: 'dev_integration', lineColor: '#C0392B', lineWidth: 4 }, |
| 293 | + { to: 'test_unit', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' } |
| 294 | + ], |
267 | 295 | color: '#0F8B8D' |
268 | 296 | }, |
269 | 297 | { |
|
272 | 300 | parent: 'testing', |
273 | 301 | start: Date.UTC(2024, 2, 23), |
274 | 302 | end: Date.UTC(2024, 2, 29), |
275 | | - dependency: 'test_integration', |
| 303 | + dependency: { to: 'test_integration', lineColor: '#C0392B', lineWidth: 4 }, |
276 | 304 | color: '#0F8B8D' |
277 | 305 | }, |
278 | 306 | // Milestone: Release Ready |
|
282 | 310 | parent: 'testing', |
283 | 311 | start: Date.UTC(2024, 2, 29), |
284 | 312 | milestone: true, |
285 | | - dependency: 'test_uat', |
| 313 | + dependency: { to: 'test_uat', lineColor: '#C0392B', lineWidth: 4 }, |
286 | 314 | color: '#1A3A5C' |
287 | 315 | } |
288 | 316 | ] |
|
298 | 326 | <script>{highcharts_gantt_js}</script> |
299 | 327 | </head> |
300 | 328 | <body style="margin:0; padding:0; background:#FAFBFC;"> |
301 | | - <div id="container" style="width:4800px; height:2700px;"></div> |
| 329 | + <div id="container" style="width:4800px; height:2550px;"></div> |
302 | 330 | <script> |
303 | 331 | {chart_config} |
304 | 332 | </script> |
|
367 | 395 | borderRadius: 5, |
368 | 396 | connectors: { |
369 | 397 | lineWidth: 2, |
370 | | - lineColor: '#5D6D7E', |
| 398 | + lineColor: '#B0BEC5', |
371 | 399 | radius: 8, |
372 | | - endMarker: { enabled: true, color: '#5D6D7E' } |
| 400 | + endMarker: { enabled: true, color: '#B0BEC5' } |
373 | 401 | } |
374 | 402 | } |
375 | 403 | }, |
|
378 | 406 | data: [ |
379 | 407 | { id: 'requirements', name: 'Requirements Phase', color: '#306998' }, |
380 | 408 | { id: 'req_gather', name: 'Gather Requirements', parent: 'requirements', start: Date.UTC(2024, 0, 1), end: Date.UTC(2024, 0, 10), color: '#306998' }, |
381 | | - { id: 'req_analysis', name: 'Requirements Analysis', parent: 'requirements', start: Date.UTC(2024, 0, 11), end: Date.UTC(2024, 0, 17), dependency: 'req_gather', color: '#306998' }, |
382 | | - { id: 'req_approval', name: 'Stakeholder Approval', parent: 'requirements', start: Date.UTC(2024, 0, 18), end: Date.UTC(2024, 0, 22), dependency: 'req_analysis', color: '#306998' }, |
383 | | - { id: 'milestone_req', name: 'Requirements Baseline \\u2713', parent: 'requirements', start: Date.UTC(2024, 0, 22), milestone: true, dependency: 'req_approval', color: '#1A3A5C' }, |
| 409 | + { id: 'req_analysis', name: 'Requirements Analysis', parent: 'requirements', start: Date.UTC(2024, 0, 11), end: Date.UTC(2024, 0, 17), dependency: { to: 'req_gather', lineColor: '#C0392B', lineWidth: 3 }, color: '#306998' }, |
| 410 | + { id: 'req_approval', name: 'Stakeholder Approval', parent: 'requirements', start: Date.UTC(2024, 0, 18), end: Date.UTC(2024, 0, 22), dependency: { to: 'req_analysis', lineColor: '#C0392B', lineWidth: 3 }, color: '#306998' }, |
| 411 | + { id: 'milestone_req', name: 'Requirements Baseline \\u2713', parent: 'requirements', start: Date.UTC(2024, 0, 22), milestone: true, dependency: { to: 'req_approval', lineColor: '#C0392B', lineWidth: 3 }, color: '#1A3A5C' }, |
384 | 412 | { id: 'design', name: 'Design Phase', color: '#D4920B' }, |
385 | | - { id: 'design_arch', name: 'Architecture Design', parent: 'design', start: Date.UTC(2024, 0, 23), end: Date.UTC(2024, 1, 2), dependency: 'milestone_req', color: '#D4920B' }, |
386 | | - { id: 'design_ui', name: 'UI/UX Design', parent: 'design', start: Date.UTC(2024, 0, 23), end: Date.UTC(2024, 1, 5), dependency: 'milestone_req', color: '#E8A817' }, |
387 | | - { id: 'design_db', name: 'Database Design', parent: 'design', start: Date.UTC(2024, 1, 3), end: Date.UTC(2024, 1, 9), dependency: 'design_arch', color: '#D4920B' }, |
| 413 | + { id: 'design_arch', name: 'Architecture Design', parent: 'design', start: Date.UTC(2024, 0, 23), end: Date.UTC(2024, 1, 2), dependency: { to: 'milestone_req', lineColor: '#C0392B', lineWidth: 3 }, color: '#D4920B' }, |
| 414 | + { id: 'design_ui', name: 'UI/UX Design', parent: 'design', start: Date.UTC(2024, 0, 23), end: Date.UTC(2024, 1, 5), dependency: { to: 'milestone_req', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, color: '#E8A817' }, |
| 415 | + { id: 'design_db', name: 'Database Design', parent: 'design', start: Date.UTC(2024, 1, 3), end: Date.UTC(2024, 1, 9), dependency: { to: 'design_arch', lineColor: '#C0392B', lineWidth: 3 }, color: '#D4920B' }, |
388 | 416 | { id: 'development', name: 'Development Phase', color: '#7B5EA7' }, |
389 | | - { id: 'dev_backend', name: 'Backend Development', parent: 'development', start: Date.UTC(2024, 1, 12), end: Date.UTC(2024, 2, 4), dependency: 'design_db', color: '#7B5EA7' }, |
390 | | - { id: 'dev_frontend', name: 'Frontend Development', parent: 'development', start: Date.UTC(2024, 1, 7), end: Date.UTC(2024, 2, 1), dependency: 'design_ui', color: '#9B7EC8' }, |
391 | | - { id: 'dev_integration', name: 'System Integration', parent: 'development', start: Date.UTC(2024, 2, 5), end: Date.UTC(2024, 2, 15), dependency: ['dev_backend', 'dev_frontend'], color: '#7B5EA7' }, |
| 417 | + { id: 'dev_backend', name: 'Backend Development', parent: 'development', start: Date.UTC(2024, 1, 12), end: Date.UTC(2024, 2, 4), dependency: { to: 'design_db', lineColor: '#C0392B', lineWidth: 3 }, color: '#7B5EA7' }, |
| 418 | + { id: 'dev_frontend', name: 'Frontend Development', parent: 'development', start: Date.UTC(2024, 1, 7), end: Date.UTC(2024, 2, 1), dependency: { to: 'design_ui', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, color: '#9B7EC8' }, |
| 419 | + { id: 'dev_integration', name: 'System Integration', parent: 'development', start: Date.UTC(2024, 2, 5), end: Date.UTC(2024, 2, 15), dependency: [{ to: 'dev_backend', lineColor: '#C0392B', lineWidth: 3 }, { to: 'dev_frontend', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }], color: '#7B5EA7' }, |
392 | 420 | { id: 'testing', name: 'Testing Phase', color: '#0F8B8D' }, |
393 | | - { id: 'test_unit', name: 'Unit Testing', parent: 'testing', start: Date.UTC(2024, 2, 5), end: Date.UTC(2024, 2, 15), dependency: 'dev_backend', color: '#0F8B8D' }, |
394 | | - { id: 'test_integration', name: 'Integration Testing', parent: 'testing', start: Date.UTC(2024, 2, 16), end: Date.UTC(2024, 2, 22), dependency: ['dev_integration', 'test_unit'], color: '#0F8B8D' }, |
395 | | - { id: 'test_uat', name: 'User Acceptance Testing', parent: 'testing', start: Date.UTC(2024, 2, 23), end: Date.UTC(2024, 2, 29), dependency: 'test_integration', color: '#0F8B8D' }, |
396 | | - { id: 'milestone_release', name: 'Release Ready \\u2605', parent: 'testing', start: Date.UTC(2024, 2, 29), milestone: true, dependency: 'test_uat', color: '#1A3A5C' } |
| 421 | + { id: 'test_unit', name: 'Unit Testing', parent: 'testing', start: Date.UTC(2024, 2, 5), end: Date.UTC(2024, 2, 15), dependency: { to: 'dev_backend', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }, color: '#0F8B8D' }, |
| 422 | + { id: 'test_integration', name: 'Integration Testing', parent: 'testing', start: Date.UTC(2024, 2, 16), end: Date.UTC(2024, 2, 22), dependency: [{ to: 'dev_integration', lineColor: '#C0392B', lineWidth: 3 }, { to: 'test_unit', lineColor: '#B0BEC5', lineWidth: 2, dashStyle: 'ShortDash' }], color: '#0F8B8D' }, |
| 423 | + { id: 'test_uat', name: 'User Acceptance Testing', parent: 'testing', start: Date.UTC(2024, 2, 23), end: Date.UTC(2024, 2, 29), dependency: { to: 'test_integration', lineColor: '#C0392B', lineWidth: 3 }, color: '#0F8B8D' }, |
| 424 | + { id: 'milestone_release', name: 'Release Ready \\u2605', parent: 'testing', start: Date.UTC(2024, 2, 29), milestone: true, dependency: { to: 'test_uat', lineColor: '#C0392B', lineWidth: 3 }, color: '#1A3A5C' } |
397 | 425 | ] |
398 | 426 | }] |
399 | 427 | }); |
|
0 commit comments