Chart Base & Helpers

ChartBase is the public low-level Chart.js canvas control. Use the specialized chart controls for automatic theme observation, or supply a complete configuration here. This example reads the theme on mount and exports the bound chart as PNG. It does not automatically re-read colors when the theme changes. In 0.0.34 the emitted ChartBase declaration shadows the Chart.js instance type with the Svelte component type; the example guards the runtime instance method instead of hiding this behind an any cast.

The specialized wrappers append alpha hex suffixes to their series colors: use six-digit hex colors for overrides, rather than CSS variables or rgb() strings. ChartBase accepts Chart.js color values directly. Set maintainAspectRatio: false when filling a fixed-height container.

Import dataset types with type-only imports: LineDataset, BarDataset, ScatterDataset, BubbleDataset, RadarDataset, ScatterPoint and BubblePoint are exported by the public declarations, not as runtime values. You can also infer wrapper props with Svelte’s ComponentProps. ChartOptions and ChartConfiguration come from chart.js, not @atom-forge/ui. Wrapper options merge plugins shallowly and x/y/r scale definitions one level deep; supplying legend or ticks replaces that nested default object.

Custom configuration and instance access

The public palette contains 8 colors.