- Overview
- shadcn/ui Charts
- Lines and Areas
- Bars and Rankings
- Scatterplots and Relationships
- Distributions
- Heatmaps and Densities
- Intervals and Financial Charts
- Stacked and Composed Charts
- Facets and Multiple Views
- Networks and Hierarchies
- Maps and Spatial Charts
- Polar and Radar Charts
- Annotations and Overlays
- Interactive Charts
- Themes and Motion
Individual Charts
- Apple stock line with seasonal gaps
- Industry unemployment with end labels
- San Francisco temperature range band
- Industry unemployment stacked area
- Sorted vertical bars
- Horizontal ranking with long labels
- Grouped bars
- Stacked bars
- Bubble scatterplot
- Histogram
- Labeled ordinal heatmap
- Anscombe quartet small multiples
- Open-to-close price intervals
- Point estimates with error bars
- Grouped boxplot
- Ranked lollipop chart
- Dumbbell comparison
- Cumulative histogram
- San Francisco temperature moving averages
- Industry share of unemployment
- Streamgraph
- Bollinger band
- Quantitative binned heatmap
- Precipitation calendar heatmap
- Diverging Likert responses
- Parallel coordinates
- Candlestick chart
- Annual gasoline-price waterfall
- Two-period slopegraph
- Scatterplot with linear regression
- Metro inequality change arrows
- Apple close versus moving average
- Pointer-selected tooltip
- Grouped X tooltip
- Tidy hierarchy tree
- Delaunay spatial network
- Filled wind-speed contours
- Point density contours
- Westport House floor plan
- Les Misérables character network
- English letter frequency waffle
- Two-dimensional vector field
- Hexagonally binned density
- Framed guide-free scatterplot
- Empirical cumulative distribution
- Faceted distributions
- Beeswarm distribution
- Log-scale Flare class sizes
- Industry unemployment bump chart
- Indexed industry unemployment
- Directed connected scatterplot
- Scatterplot with marginal histograms
- Annotated AAPL extrema
- Mean penguin mass reducer bars
- AAPL lag-one autocorrelation
- Industry unemployment percentile ribbon
- Ridgeline density comparison
- Violin distribution comparison
- Marimekko survey composition
- Voronoi nearest-point interaction
- Seattle weather with three y axes
- Palmer penguins by species and sex
- Stacked and adjacent Seattle weather bars
- Automobile specifications scatter
- Flare analytics treemap
- Simple radar chart
- English letter frequency pie
- English letter frequency donut
- Survey agreement share gauge
- Snapped axis pointer with grouped tooltip
- Interactive series legend
- Linked chart and data table selection
- Focus and context time window
- Expanding pinned energy tooltip
- Scrollable resource timeline lanes
- Streaming window preservation
- Synchronized cursors across views
- Free cursor over car measurements
- Observed monthly AAPL brush selection
- Wheel zoom and pan over AAPL closes
- AAPL close playback scrubber
- Editable event range
- Letter frequency pie with labels
- Letter frequency donut with total
- Rounded letter frequency donut
- Nested Flare package sizes
- English letter frequency rose
- County unemployment gauge
- Comparative radar chart
- Concentric letter frequency bars
- Flare analytics sunburst
- World learning-poverty choropleth
- World population bubble map
- Orthographic globe with graticule
- HMS Beagle voyage
- Seattle daily high-temperature polar line
- Surface wind polar scatter
- World population-density choropleth
- United States county unemployment choropleth
- Standard world projection gallery
- Basic Sankey
- Sankey
- Staggered entrance motion
- Interrupted spring updates
- Spring line updates
- Definition-owned motion
- Cross-chart geometry morph
- Focus and crosshair motion
- Token use calendar heatmap
- Stacked bars with band and rule cursors
- Themed interactive area card
- Active bar dashboard
- Premium KPI sparklines
- Active donut metric
- Theme palette matrix
- Sales conversion funnel
- Drillable Flare sunburst
- shadcn dashboard
- shadcn Bar Chart - Multiple
- shadcn Pie Chart - Donut with Text
- shadcn Radar Chart - Multiple
- shadcn Radial Chart - Text
- shadcn Tooltip - Advanced
- shadcn Area Chart - Axes
- shadcn Area Chart
- shadcn Area Chart - Gradient
- shadcn Area Chart - Icons
- shadcn Area Chart - Interactive
- shadcn Area Chart - Legend
- shadcn Area Chart - Linear
- shadcn Area Chart - Stacked Expanded
- shadcn Area Chart - Stacked
- shadcn Area Chart - Step
- shadcn Bar Chart - Active
- shadcn Bar Chart
- shadcn Bar Chart - Horizontal
- shadcn Bar Chart - Interactive
- shadcn Bar Chart - Custom Label
- shadcn Bar Chart - Label
- shadcn Bar Chart - Mixed
- shadcn Bar Chart - Negative
- shadcn Bar Chart - Stacked + Legend
- shadcn Line Chart
- shadcn Line Chart - Dots Colors
- shadcn Line Chart - Custom Dots
- shadcn Line Chart - Dots
- shadcn Line Chart - Interactive
- shadcn Line Chart - Custom Label
- shadcn Line Chart - Label
- shadcn Line Chart - Linear
- shadcn Line Chart - Multiple
- shadcn Line Chart - Step
- shadcn Pie Chart - Donut Active
- shadcn Pie Chart - Donut
- shadcn Pie Chart - Interactive
- shadcn Pie Chart - Custom Label
- shadcn Pie Chart - Label List
- shadcn Pie Chart - Label
- shadcn Pie Chart - Legend
- shadcn Pie Chart - Separator None
- shadcn Pie Chart
- shadcn Pie Chart - Stacked
- shadcn Radar Chart
- shadcn Radar Chart - Dots
- shadcn Radar Chart - Grid Circle Filled
- shadcn Radar Chart - Grid Circle - No lines
- shadcn Radar Chart - Grid Circle
- shadcn Radar Chart - Grid Custom
- shadcn Radar Chart - Grid Filled
- shadcn Radar Chart - Grid None
- shadcn Radar Chart - Icons
- shadcn Radar Chart - Custom Label
- shadcn Radar Chart - Legend
- shadcn Radar Chart - Lines Only
- shadcn Radar Chart - Radius Axis
- shadcn Radial Chart - Grid
- shadcn Radial Chart - Label
- shadcn Radial Chart - Shape
- shadcn Radial Chart
- shadcn Radial Chart - Stacked
- shadcn Tooltip - Default
- shadcn Tooltip - Formatter
- shadcn Tooltip - Icons
- shadcn Tooltip - Line Indicator
- shadcn Tooltip - No Indicator
- shadcn Tooltip - Custom label
- shadcn Tooltip - Label Formatter
- shadcn Tooltip - No Label
Bars and Rankings
Bars answer categorical magnitude questions through length from a shared baseline. Sort them when rank is part of the question, keep a semantic order when sequence matters, and use a lighter comparison mark when a filled bar would overstate the data.
Choose the comparison#
| Reader question | Start with |
|---|---|
| Which category has the largest or smallest value? | Sorted bars |
| Which categories have notable endpoints without emphasizing area? | Lollipops |
| How far apart are two values for each category? | Dumbbells |
| How do signed contributions bridge from a start to a total? | A waterfall |
| How do subgroups contribute to each category? | Grouped or stacked bars in Stacked and Composed Charts |
Use horizontal bars when labels are long or when the rank itself should read top to bottom. Layout, Axes, and Coordinates shows how categorical orientation and automatic guide margins fit together.
Rank categories with bars#
Sorting the scale domain makes the intended ranking explicit. Sorting only the input rows is insufficient when several layers or prepared datasets share the same categorical axis.
import { barY, defineChart } from '@tanstack/charts'
import { scaleBand } from '@tanstack/charts/scales/band'
import { scaleLinear } from '@tanstack/charts/scales/linear'
const rows = [
{ category: 'Search', value: 84 },
{ category: 'Direct', value: 63 },
{ category: 'Referral', value: 47 },
{ category: 'Social', value: 31 },
]
const ranked = [...rows].sort((a, b) => b.value - a.value)
const chart = defineChart({
marks: [barY(ranked, { x: 'category', y: 'value', inset: 2 })],
scales: {
x: {
scale: () =>
scaleBand<string>()
.domain(ranked.map((row) => row.category))
.padding(0.16),
},
y: {
scale: scaleLinear,
nice: true,
grid: true,
axis: { label: 'Weekly signups' },
},
},
})
export default chartOpen the larger catalog case to inspect responsive label rotation and data updates.
Bar charts normally include zero on the quantitative domain. Truncating that baseline turns small differences into large apparent changes.
Reduce visual weight with lollipops#
A lollipop keeps the common baseline and precise endpoint while replacing the filled rectangle with a thin link. It is useful for many categories or when the endpoint matters more than area.
Compose the stem and endpoint as separate marks. The Rules, Links, Arrows, Vectors, and Ticks reference defines the link channels; Dot and Hexagon Marks defines the endpoint layer.
Compare two values per category#
Dumbbells emphasize the distance and direction between two endpoints without implying the combined area of grouped bars.
Label the endpoint semantics in a legend or surrounding text. If chronological order between two periods is the message, a slopegraph may be more direct; if absolute magnitudes must remain independently comparable, use grouped bars.
Explain a bridge to a total#
A waterfall requires cumulative preparation. Each contribution becomes an explicit lower and upper interval; the renderer should not guess whether a row is a delta, subtotal, or total.
Keep the cumulative calculation in application data preparation and pass the prepared interval channels to a ranged bar or rectangle. The ownership boundary is described in Scales, and the geometry contracts are in Bar and Rect Marks.
Production checks#
- Preserve a semantic category order unless rank is the question.
- Include zero for ordinary bar magnitudes; use explicit interval endpoints for floating and waterfall bars.
- Avoid encoding the same distinction only by color. Labels, position, and shape can carry the essential comparison.
- Verify long labels and rotated ticks with Responsive Charts.
- Preserve unique category values when bars reorder or animate; supply key only when the category does not identify a row. See Dynamic Data and Animation.