{"version":"2.1.206","anchor":"chart-js-runtime-in-published-artifacts","canonical_anchor":"chart-js-runtime-in-published-artifacts","heading":"Chart.js Runtime in Published Artifacts","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.206\/e\/chart-js-runtime-in-published-artifacts","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.206","markdown":"### Chart.js Runtime in Published Artifacts\n\n**What**\n\nArtifacts that include a `<script type=\"application\/json\" data-chart-runtime>` chart spec now receive an injected Chart.js runtime at publish time, enabling bar and donut charts in addition to SVG line charts.\n\n**Details**\n\n- The publish pipeline detects the `data-chart-runtime` attribute and injects a bundled Chart.js into the artifact HTML between `<!-- chart-runtime -->` \/ `<!-- \/chart-runtime -->` sentinel comments.\n- Safety checks reject bundles containing `<\/script`, HTML comment injection risks, or the sentinel strings themselves.\n- The runtime reads the spec from the `data-chart-runtime` element and renders into `#primary-chart` via Chart.js, fully replacing the SVG fallback.\n- Theme support: resolves CSS custom properties from `getComputedStyle` at render time and re-renders on system dark-mode changes or `data-theme` flips \u2014 same data, same pixels per theme.\n- Multi-series line\/bar charts include a legend; donut charts accept per-slice color overrides.\n- The SVG fallback remains for environments without the runtime, covering the standard time-series line case.\n\n**Evidence**\n\nSentinel string (search for `\"bundle contains the chart-runtime sentinel\"`); runtime injection (search for `\"chart-runtime -->\"`); Chart.js integration (search for `\"new Chart(canvas\"`)"}