BaseChartConfig
Defined in: types/index.ts:188
Options shared by every chart type.
Example
new BarChart('#chart', { theme: 'arctic', title: 'Quarterly revenue', subtitle: 'In thousands USD', formatValue: (v) => `$${v}k`, onClick: (i, data) => console.log('clicked', data.labels[i]), animDuration: 800, ariaLabel: 'Quarterly revenue bar chart',});Extended by
Properties
animate?
optionalanimate?:boolean
Defined in: types/index.ts:192
Run an entry animation on the first render and on data updates. Default true.
animDuration?
optionalanimDuration?:number
Defined in: types/index.ts:194
Animation duration in milliseconds. Default 600.
animEasing?
optionalanimEasing?:EasingName
Defined in: types/index.ts:196
Easing curve. Default 'easeOutCubic'.
ariaDescription?
optionalariaDescription?:string
Defined in: types/index.ts:230
Longer accessible description (rendered as canvas aria-description).
ariaLabel?
optionalariaLabel?:string
Defined in: types/index.ts:228
Accessible label for screen readers (rendered as canvas aria-label).
formatValue?
optionalformatValue?: (value) =>string
Defined in: types/index.ts:221
Format a numeric value for axis ticks, tooltips, and labels.
Parameters
value
number
Returns
string
Example
formatValue: (v) => v >= 1000 ? `${(v/1000).toFixed(1)}k` : `${v}`legendPosition?
optionallegendPosition?:LegendPosition
Defined in: types/index.ts:208
Where the legend appears relative to the plot. Default 'top'.
onClick?
optionalonClick?: (index,data) =>void
Defined in: types/index.ts:226
Click handler invoked with the index of the clicked data point and the resolved data shape so consumers can read the underlying row.
Parameters
index
number
data
Returns
void
padding?
optionalpadding?:Partial<Padding>
Defined in: types/index.ts:200
Override the auto-computed plot area padding (pixels).
responsive?
optionalresponsive?:boolean
Defined in: types/index.ts:198
Auto-resize when the container size changes via ResizeObserver. Default true.
showGrid?
optionalshowGrid?:boolean
Defined in: types/index.ts:202
Show grid lines on the plot area. Default true.
showLegend?
optionalshowLegend?:boolean
Defined in: types/index.ts:206
Render a legend listing each series. Default true.
showTooltip?
optionalshowTooltip?:boolean
Defined in: types/index.ts:204
Render an interactive tooltip on hover. Default true.
subtitle?
optionalsubtitle?:string
Defined in: types/index.ts:212
Sub-heading rendered under the title.
theme?
Defined in: types/index.ts:190
Theme name ('midnight' etc.) or a complete Theme object.
title?
optionaltitle?:string
Defined in: types/index.ts:210
Chart heading rendered above the plot.