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,
}
NameTypeDefaultDescription
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

NameTypeDefaultDescription
ChartBoxplotGroupBoxplot—Five-number summary and outliers.
ChartCandlestickDatumCandlestick—Open, high, low, close, and volume.
ChartHeatmapCellHeatmap—Row and column indexes with a value.
ChartHierarchyNodeSunburst, Treemap—Nested nodes with values on leaves.
ChartTimePointsTimeSeries—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.