{"spec_id":"burndown-sprint","library":"highcharts","language":"javascript","code":"// anyplot.ai\n// burndown-sprint: Agile Sprint Burndown Chart\n// Library: highcharts 12.6.0 | JavaScript 22.22.3\n// Quality: 91/100 | Created: 2026-06-14\n//# anyplot-orientation: landscape\n\nconst THEME = window.ANYPLOT_THEME || \"light\";\nconst t = window.ANYPLOT_TOKENS;\n\n// Sprint data: 10 working days (Jun 2–13 2025), initial scope 40 story points\nconst categories = [\n  \"Start\",  \"Jun 2\", \"Jun 3\", \"Jun 4\",  \"Jun 5\",\n  \"Jun 6\",  \"Jun 7\", \"Jun 8\", \"Jun 9\",  \"Jun 10\",\n  \"Jun 11\", \"Jun 12\", \"Jun 13\"\n];\n\n// Actual remaining story points (step series);\n// +8 scope added end of Jun 5 (Thu, day 4) — team finishes at zero by sprint end\nconst actualRemaining = [40, 37, 33, 30, 34, 30, 30, 30, 24, 18, 10, 5, 0];\n\n// Ideal burndown: 40 → 0 linearly over 10 working days (flat on weekends)\nconst idealRemaining  = [40, 36, 32, 28, 24, 20, 20, 20, 16, 12,  8, 4, 0];\n\n// Weekend band: subtly distinct from the page background\nconst weekendColor = THEME === \"light\"\n  ? \"rgba(26,26,23,0.06)\"\n  : \"rgba(240,239,232,0.08)\";\n\nHighcharts.chart(\"container\", {\n  chart: {\n    backgroundColor: \"transparent\",\n    animation: false,\n    style: { fontFamily: \"inherit\" },\n    marginTop: 60,\n    marginRight: 40,\n    marginBottom: 80,\n    marginLeft: 80,\n  },\n  credits: { enabled: false },\n  colors: t.palette,\n  title: {\n    text: \"burndown-sprint · javascript · highcharts · anyplot.ai\",\n    style: { color: t.ink, fontSize: \"22px\", fontWeight: \"600\" },\n    margin: 20,\n  },\n  xAxis: {\n    categories,\n    lineColor: t.inkSoft,\n    tickColor: t.inkSoft,\n    labels: { style: { color: t.inkSoft, fontSize: \"13px\" }, rotation: -30 },\n    title: {\n      text: \"Sprint Day\",\n      style: { color: t.inkSoft, fontSize: \"16px\" },\n      margin: 15,\n    },\n    plotBands: [\n      {\n        from: 5.5,\n        to: 7.5,\n        color: weekendColor,\n        label: {\n          text: \"Weekend\",\n          style: { color: t.inkSoft, fontSize: \"12px\" },\n          align: \"center\",\n          verticalAlign: \"top\",\n          y: 15,\n        },\n      },\n    ],\n    plotLines: [\n      {\n        value: 4,\n        color: \"#DDCC77\",\n        dashStyle: \"ShortDash\",\n        width: 2,\n        zIndex: 5,\n        label: {\n          text: \"Scope +8 pts\",\n          style: { color: \"#DDCC77\", fontSize: \"12px\", fontWeight: \"600\" },\n          align: \"left\",\n          rotation: 0,\n          x: 5,\n          y: 80,\n        },\n      },\n    ],\n  },\n  yAxis: {\n    title: {\n      text: \"Remaining Story Points\",\n      style: { color: t.inkSoft, fontSize: \"16px\" },\n    },\n    min: 0,\n    gridLineColor: t.grid,\n    lineColor: t.inkSoft,\n    tickColor: t.inkSoft,\n    labels: { style: { color: t.inkSoft, fontSize: \"14px\" } },\n  },\n  legend: {\n    enabled: true,\n    itemStyle: { color: t.inkSoft, fontSize: \"14px\" },\n    itemHoverStyle: { color: t.ink },\n    backgroundColor: \"transparent\",\n    borderWidth: 0,\n  },\n  plotOptions: {\n    series: {\n      animation: false,\n      marker: { enabled: false },\n    },\n  },\n  series: [\n    {\n      name: \"Actual Remaining\",\n      data: actualRemaining,\n      type: \"line\",\n      step: \"left\",\n      color: t.palette[0],\n      lineWidth: 2.5,\n      zIndex: 2,\n    },\n    {\n      name: \"Ideal Burndown\",\n      data: idealRemaining,\n      type: \"line\",\n      color: t.inkSoft,\n      dashStyle: \"ShortDash\",\n      lineWidth: 2,\n      zIndex: 1,\n    },\n  ],\n});\n"}