Charts that feel alive.
Financial charts
- Closed higher
- Closed lower
| Date | Open | High | Low | Close |
|---|---|---|---|---|
| Sep 14 | 183.27 | 187.04 | 181.79 | 185.38 |
| Sep 15 | 186.76 | 188.08 | 186.34 | 186.53 |
| Sep 16 | 186.16 | 189.51 | 186.15 | 187.95 |
| Sep 17 | 187.72 | 194.01 | 186.65 | 191.84 |
| Sep 18 | 190.94 | 193.48 | 189.43 | 192.49 |
| Sep 21 | 192.16 | 193.08 | 191.43 | 191.83 |
| Sep 22 | 192.67 | 195.62 | 191.54 | 194.02 |
| Sep 23 | 192.99 | 197.2 | 190.91 | 197.14 |
| Sep 24 | 197.48 | 197.97 | 193.99 | 195.27 |
| Sep 25 | 195.67 | 198.61 | 195.59 | 198.28 |
| Sep 28 | 199.29 | 201.25 | 199.24 | 201.05 |
| Sep 29 | 200.67 | 201.92 | 200.37 | 201.76 |
| Sep 30 | 201.67 | 203.45 | 200.68 | 200.68 |
| Oct 1 | 200.73 | 201.74 | 199.2 | 199.57 |
| Oct 2 | 199.96 | 201.53 | 199.8 | 200.11 |
| Oct 5 | 200.66 | 202.6 | 200.62 | 202.26 |
| Oct 6 | 202.27 | 203.89 | 201.66 | 202.94 |
| Oct 7 | 204.55 | 206.8 | 203.24 | 205.18 |
| Oct 8 | 204.15 | 205.29 | 202.26 | 202.35 |
| Oct 9 | 202.68 | 203.97 | 202.27 | 202.91 |
| Oct 12 | 203.27 | 204.28 | 201.69 | 202.67 |
Candlestick
- Increase
- Decrease
- Total
| Item | Change | Running total |
|---|---|---|
| Revenue | $642,000 | $642,000 |
| Cost of sales | -$186,000 | $456,000 |
| Payroll | -$248,000 | $208,000 |
| Marketing | -$74,000 | $134,000 |
| Software | -$39,000 | $95,000 |
| Interest | $8,000 | $103,000 |
| Net profit | $103,000 | $103,000 |
Waterfall
From gallery to app
Installation
Usage
Build the definition with TanStack Charts. Show it with Chart, in a ChartFrame.
traffic-chart.tsx
Composition
ChartFrameSets the series colors and the tooltip styles.
ChartCaptionOptionalChartTitleChartValueOptionalChartDescriptionOptional
ChartActionOptionalShows beside the caption. Moves below it on narrow screens.
ChartOwns the motion. Accepts the TanStack core Chart props.
ChartCenterOptionalCovers the plot and centers its content, such as a donut total.
ChartLegendOptionalChartLegendItemRepeats
ChartTableScreen readers only.
Motion
- When a chart scrolls into view, it fades in. Its bar, line, area, and arc marks grow from their baseline.
- A chart that the server renders on screen does not move when the page loads. A chart that mounts later, for example after a link, grows in.
- When the data changes, each mark moves to its new value. Give each mark a stable
key.
To change the motion of one chart, give it a renderer.
revenue-chart.tsx
To stop the motion, use the static SVG renderer.
revenue-chart.tsx
Theming
Charts use the colors --chart-1 to --chart-6. Set them for light and dark mode.
globals.css
To change one chart, set a color on its frame.
chart.tsx
Accessibility
ariaLabelnames the chart for screen readers.ChartTablegives screen readers the exact values.- Press Tab to focus a chart that has tooltips. Use the arrow keys to move between points.
- Press Enter to pin a tooltip. Press Escape to close it.
- When reduced motion is on, charts show at once and do not move.
API reference
TanStack Charts API (opens in a new tab)All parts also accept className and native HTML attributes.
ChartFrame
- --ts-chart-1: color = var(--chart-1)
- The color of the first series. --ts-chart-2 to --ts-chart-6 set the other series. Set them in style to change the colors of one chart.
ChartAction
- children: ReactNode
- Controls for the chart, such as a period toggle.
Chart
Also accepts the props of the TanStack core Chart, such as definition, ariaLabel, height, and initialWidth.
- renderer: ChartRenderer = chartMotion
- Draws and animates the chart. chartMotion is a TanStack motion renderer with a spring.
- children: ReactNode
- Content on top of the plot, such as ChartCenter.
ChartLegendItem
- color: stringRequired
- The series color. Use the same value as the mark.
- swatch: "square" | "line" | "dashed" = "square"
- The swatch shape. Use line for a line series and dashed for a dashed line.
ChartTable
- caption: stringRequired
- Names the table for screen readers.
- columns: string[]Required
- Column headings. The first column labels each row.
- rows: (string | number)[][]Required
- The exact values. The table is visible to screen readers only.