Start with the comparison a reader must make. A chart type is the result of that decision, not the starting point.
TanStack Charts does not inspect a dataset and choose a chart automatically. Data exploration, cleaning, and recommendation belong in application tooling or an authoring skill. The runtime receives data that is ready to encode.
| Reader task | First choice | Common alternatives |
|---|---|---|
| Follow change over ordered time | Line | Area for accumulated magnitude; bars for discrete periods |
| Compare named categories | Horizontal bars | Dots or lollipops when a zero baseline is not the message |
| Compare two values per category | Dumbbell or slopegraph | Grouped bars when absolute magnitude matters |
| Inspect a relationship | Scatterplot | Bubble scatterplot for a third quantitative value |
| Inspect one distribution | Histogram | ECDF when cumulative probability matters |
| Compare distributions | Boxplot or violin | Faceted histograms when shape details matter |
| Show an interval | Range area, interval bar, or error bar | Candlestick for financial open-high-low-close data |
| Show composition | Stacked bars or areas | Normalized stack for proportions; mosaic for two categorical dimensions |
| Show a matrix | Heatmap | Labeled cells for small matrices |
| Repeat the same view by group | Facets | Linked views when each panel needs a different role |
| Show topology | Node-link diagram | Matrix encoding when the network is dense |
| Edit or navigate a time range | Chart plus semantic controls | Brush, zoom, or scrubber owned by the application |
The chart examples show these choices as executable compositions.
Before choosing marks, identify:
Keep those rows in their natural application shape. Use channels to map fields or accessors into visual properties. Do not convert data into a library-owned series structure.
Use this escalation order:
Composition is usually enough. A boxplot, for example, is a prepared summary rendered with rectangles, rules, ticks, and dots. A candlestick is a link plus a ranged rectangle. A focus-and-context view is two charts sharing semantic state.
See Marks and Layering, Faceting and Composition, and Custom Marks and Renderers for the corresponding boundaries.
The Large Data guide covers the raw-versus-encoded decision.
A chart is ready when:
If the first attempt fails one of these checks, change the representation before adding decorative complexity.