Traffic by source
Visits in thousands. Click a legend item to hide it.
Installation
$ pnpm dlx shadcn@latest add @synccn/line-chartFirst time in this project? Connect synccn with one command.
Usage
import { LineChart } from "@/components/ui/charts";<LineChart labels={months} series={[{ name: "Search", values }]} />API reference
Generated from the component's TypeScript types, so it always matches the code.
LineChart
Multi-series line chart with a legend and a shared crosshair. series: [{ name, values: number[] }]
PropTypeDescription
- labelsrequired
string[]X-axis labels.
- seriesrequired
{ name: string; values: number[] }[]One entry per line.
- height
numberDefault
220Chart height in pixels.
- format
(value: number) => React.ReactNodeDefault
(v) => vFormats ticks and tooltip values.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: img, meter
- ARIA attributes: aria-label, aria-pressed, aria-valuemax, aria-valuemin, aria-valuenow
More data
Data TableSorting, search, column visibility, selection and paging.Bar ChartResponsive SVG bars with tooltips and an entrance.Area ChartSmooth area with a crosshair tooltip.SparklineTiny trend line coloured by direction.HeatmapContribution-style calendar of daily counts.KanbanDrag cards between columns.