Dune Charts

Bar chart

Grouped, stacked, and horizontal comparisons with pixel fills.

Use bar charts to compare categories. Bars share the same fill and pixel options as area charts. Stack with stackId. Flip layout with layout="vertical" (horizontal bars).

BarsGrouped pixel bars.

Examples

Stacked

Share stackId on each <DuneBarChart.Bar />.

Stacked barsStacked pixel bars.

Horizontal

Set layout="vertical" and put the category key on YAxis.

Horizontal barsCategories on Y as pixel rows.

Loading

Set loading on the root to show a pixel skeleton until data is ready.

Loading…

Parts

PartRole
DuneBarChartRoot: data, config, fill, pixel, layout, loading
DuneBarChart.GridCartesian grid
DuneBarChart.XAxisValue or category axis
DuneBarChart.YAxisCategory or value axis
DuneBarChart.TooltipHover tooltip
DuneBarChart.LegendSeries legend
DuneBarChart.BarOne series (dataKey, optional stackId)

Props

Root

PropTypeDefaultNotes
dataRecord<string, unknown>[]requiredRow objects
configRecord<string, DuneSeriesConfig>-Labels and colors
fill"bands" | "dither""bands"Pixel fill mode
pixelnumber2Cell size in CSS px
layout"horizontal" | "vertical""horizontal"vertical draws horizontal bars
loadingbooleanfalsePixel skeleton
emptyMessagestring-Empty-state copy
chartPropsobject-Extra Recharts BarChart props
classNamestring-Wrapper class

Bar

PropTypeNotes
dataKeystringSeries field
stackIdstringShared id stacks bars
namestringOverrides legend name
isAnimationActivebooleanSeries animation

Tips

  • For horizontal bars, category goes on YAxis and values go on XAxis.
  • Stacked and grouped are the same parts API. Only stackId changes.
  • Use chartProps for Recharts options such as barCategoryGap.

On this page