Data types
All chart data is plain serializable data. Import types from the same entry point as Chart.
Common data
tsx
import type { ChartDatum, ChartSeries } from '@hzblj/zyplot'
const revenue: ChartSeries = {
id: 'revenue',
label: 'Revenue',
values: [42, 56, null, 72], // null creates a gap
}
const slice: ChartDatum = {
id: 'direct',
label: 'Direct',
value: 46,
}| Name | Type | Default | Description |
|---|---|---|---|
ChartSeries | { id, label, values, color?, slot? } | — | Named values aligned with categories. |
ChartDatum | { id, label, value, color?, slot? } | — | One labeled value. |
ChartNumberFormat | { locale?, decimals?, prefix?, suffix? } | — | Number formatting shared by labels and tooltips. |
Specialized data
| Name | Type | Default | Description |
|---|---|---|---|
ChartBoxplotGroup | Boxplot | — | Five-number summary and outliers. |
ChartCandlestickDatum | Candlestick | — | Open, high, low, close, and volume. |
ChartHeatmapCell | Heatmap | — | Row and column indexes with a value. |
ChartHierarchyNode | Sunburst, Treemap | — | Nested nodes with values on leaves. |
ChartTimePoints | TimeSeries | — | Timestamps and parallel value arrays. |
Presentation
Axes, annotations, interaction, animation, series styles, themes, and surfaces are typed objects. Use the builders when you want autocomplete for a specific variant.