Tac UIv1.1.2

Charts

Responsive chart components built on Chart.js with Tac UI design tokens. Minimal grid lines, restrained monochrome palette, and clean typography.

Bar Chart

Vertical bars with per-bar color via the chart token palette. Grid lines are near-invisible for a clean canvas.

tsx
<BarChart
  data={[
    { label: 'Jan', value: 42 },
    { label: 'Feb', value: 58 },
    { label: 'Mar', value: 35 },
    { label: 'Apr', value: 71 },
    { label: 'May', value: 63 },
    { label: 'Jun', value: 89 },
  ]}
  colors={[
    'var(--chart-1)', 'var(--chart-2)', 'var(--chart-3)',
    'var(--chart-4)', 'var(--chart-5)', 'var(--chart-6)',
  ]}
  showValues
/>

Line Chart

Smooth line with optional area fill and data points. Uses a single color from the chart palette.

tsx
<LineChart
  data={[
    { label: 'Mon', value: 20 },
    { label: 'Tue', value: 45 },
    { label: 'Wed', value: 38 },
    { label: 'Thu', value: 60 },
    { label: 'Fri', value: 55 },
    { label: 'Sat', value: 30 },
    { label: 'Sun', value: 15 },
  ]}
  showDots
  showArea
/>

Pie Chart

Proportional slices with legend. Borders blend into the background for clean separation.

tsx
<PieChart
  data={[
    { label: 'Desktop', value: 54 },
    { label: 'Mobile', value: 34 },
    { label: 'Tablet', value: 12 },
  ]}
  showValues
/>

Donut Chart

Donut variant with a refined ring width. Hover for percentage tooltips.

tsx
<DonutChart
  data={[
    { label: 'Completed', value: 48 },
    { label: 'In Progress', value: 27 },
    { label: 'Pending', value: 15 },
  ]}
  showValues
/>

API Reference — BarChart

PropTypeDefaultDescription
dataChartDataPoint[]-Array of { label, value } data points to render.
heightnumber200Height of the SVG in pixels.
showGridbooleantrueWhether to show horizontal grid lines.
showLabelsbooleantrueWhether to show x-axis labels below bars.
showValuesbooleanfalseWhether to show value labels above bars.
colorstringvar(--chart-1)CSS color for all bars.
colorsstring[]-Per-bar color overrides.

API Reference — LineChart

PropTypeDefaultDescription
dataChartDataPoint[]-Array of { label, value } data points to render.
heightnumber200Height of the SVG in pixels.
showDotsbooleantrueWhether to show dots at each data point.
showAreabooleanfalseWhether to fill the area under the line.
showGridbooleantrueWhether to show horizontal grid lines.
colorstringvar(--chart-1)CSS color for the line and dots.
strokeWidthnumber2Stroke width of the line.

API Reference — PieChart / DonutChart

PropTypeDefaultDescription
dataPieChartDataPoint[]-Array of { label, value, color? } data points.
sizenumber200Diameter of the chart in pixels.
variant"pie" | "donut""pie"Whether to render as a pie or a donut. DonutChart defaults to "donut".
strokeWidthnumber20Ring width for the donut variant in pixels.
showLabelsbooleantrueWhether to show the legend below the chart.
showValuesbooleanfalseWhether to show percentage values (donut: center total; pie: in slice).