Charts use Chart.js with a set of opinionated defaults that align them with the design system's visual language.
The following adjustments are applied on top of the default Chart.js configuration:
plugins.tooltip.enabled: false
animation: false at the
options level.
categoryPercentage: 1,
barPercentage: 0.92 — set at the
options level.
Chart-specific palette tokens use the --m__chart-* prefix.
Grid and tick colors are read from
--m__text and
--m__text-caption via
getComputedStyle. Grid color is derived as
color-mix(in srgb, --m__text 12%, transparent). Palette tokens are defined in tokens/colors.css.
A MutationObserver watches the
class attribute on <body>.
position: "bottom",
labels.usePointStyle: true,
labels.pointStyle: "circle",
labels.boxWidth: 8,
labels.boxHeight: 8.
plugins.legend.display: false for
single-dataset charts.
ticks.maxRotation: 0
The formatter tracks the current month while iterating through
sorted dates. On month change (or at index 0) it outputs
toLocaleDateString("en-US",
{ month: "short", day: "numeric" }); otherwise — d.getDate().
A CanvasGradient runs from
chartArea.top to chartArea.bottom with
stops at 0 → rgba(…, 0.35),
0.67 → rgba(…, 0.35),
1 → rgba(…, 0). Base color:
--m__chart-default. Y-axis
uses grace: "25%".
pointHoverRadius: 2.5 with
pointRadius: 0 on the dataset; hover color is
rgbToRgba(baseRgb, 0.9).
interaction: { mode: "index", intersect: false }
on all charts. Bar hover color uses
hoverBackgroundColor: lightenColor(color, 0.35)
— mixes the base color with white to brighten consistently in
both light and dark themes.
A <p class="chart-status-bar"> element sits
below the chart container; its innerHTML is
replaced on mousemove and cleared on
mouseleave. Values are read with
chart.getElementsAtEventForMode(e, "index", { intersect: false }). min-height: 1.3em reserves the space so the
widget height does not change.
A <div class="chart-legend"> element is
populated with innerHTML on every render and
updated on mousemove / mouseleave.
Chart.js built-in legend is disabled
(plugins.legend.display: false).