Chart

A bar, line, area, scatter, pie or donut chart. "data" is a list of objects. "xKey" is the field of the category. "series" are the value fields.

Examples

Loading examples…

Props

PropTypeDescription
chartType"bar" | "line" | "area" | "scatter" | "pie" | "donut"Default "bar"
dataobject[]A list of objects, or { "@path": "/x" }
xKeystringThe field of the category axis
seriesstring | object[]The value fields: strings or { "key", "label"?, "color"? }. Default: every number field except xKey
stackedboolean
layout"vertical" | "horizontal""horizontal" draws the bars from left to right. Default "vertical"
yAxisobjectThe value axis configuration object: {label?: string, min?: number, max?: number, width?: number}. Example: {label: "Revenue (USD)", min: 0, max: 100}. In horizontal charts, label, min and max apply to the horizontal value axis, and width sets the width of the category axis on the left.
showDotsbooleanPoint markers on a line or area
barRadiusnumberThe corner radius of a bar, in pixels
innerRadiusnumber | stringPie and donut
outerRadiusnumber | stringPie and donut
startAnglenumberPie and donut. Default 90
endAnglenumberPie and donut. Default -270
cornerRadiusnumberThe corners of a slice
paddingAnglenumberThe gap between slices
showLabelLinesbooleanLeader lines of the slice labels. Default true
heightnumberPixels. Default 240
showLegendbooleanDefault true
showGridbooleanDefault true
showTooltipbooleanDefault true
showValueLabelsboolean
format"number" | "currency" | "percent"Number formatting. With "percent", data values and axis min/max are fractions: 0.4 displays as 40%. For 0% to 10%, use min: 0 and max: 0.1.
currencystringISO code. Default "USD"
titlestring

Link to Chart · All standard components

On this page