DS0
Components

Chart

A chart component supporting bar, line, and area chart types with built-in SVG rendering.

Overview

Chart renders data visualizations using composable SVG-based chart primitives. Supports bar, line, and area types with axes, grids, tooltips, and legends.

Usage

<Chart data={data} type="bar" height={300}>
  <Chart.XAxis dataKey="month" />
  <Chart.YAxis />
  <Chart.Grid />
  <Chart.Bar dataKey="revenue" fill="var(--color-primary)" />
  <Chart.Tooltip />
</Chart>

Line Chart

<Chart data={data} type="line" height={300}>
  <Chart.XAxis dataKey="date" />
  <Chart.YAxis />
  <Chart.Line dataKey="users" stroke="var(--color-primary)" />
</Chart>

API Reference

PropTypeDefaultDescription
dataRecord<string, unknown>[][]Chart data array
type'bar' | 'line' | 'area''bar'Chart type
heightnumber300Chart height in pixels
responsivebooleantrueAuto-resize with container
ComponentWhen to Use Instead
SparklineInline mini chart
HeatMapGrid-based heat visualization
StatCardSingle metric with trend

On this page