Skip to content

Chart

Gen UI 2.0 standard

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.

One of the 69 components in CopilotKit's standardUI. The playground's catalog extends it, so every agent here can use Chart. Standard catalog docs

Props

Read from standardUI.manifestComponents in the installed @copilotkit/react-core. In A2UI 1.0 any value may also be a { "@path" } binding into the surface data model or a { "@call" } function call.

PropTypeRequiredDescription
dataobject[]No-
xKeystringNoThe field of the category axis
series(string | { key, label?, color? })[]NoDefault: every number field except xKey
chartType"bar" | "line" | "area" | "scatter" | "pie" | "donut"NoDefault "bar"
stackedbooleanNo-
layout"vertical" | "horizontal"No"horizontal" draws the bars from left to right. Default "vertical"
yAxis{ label?, min?, max?, width? }NoExample: {label: "Revenue (USD)", min: 0, max: 100}. In a horizontal chart it is the horizontal axis, and width sets the category axis width
showDotsbooleanNoPoint markers on a line or area
barRadiusnumberNoThe corner radius of a bar, in pixels
innerRadiusnumber | stringNoPie and donut
outerRadiusnumber | stringNoPie and donut
startAnglenumberNoPie and donut. Default 90
endAnglenumberNoPie and donut. Default -270
cornerRadiusnumberNoThe corners of a slice
paddingAnglenumberNoThe gap between slices
showLabelLinesbooleanNoLeader lines of the slice labels. Default true
showLegendbooleanNoDefault true
showGridbooleanNoDefault true
showTooltipbooleanNoDefault true
showValueLabelsbooleanNo-
format"number" | "currency" | "percent"NoWith "percent", data values and axis min/max are fractions: 0.4 shows as 40%; for 0% to 10%, use min: 0 and max: 0.1.
currencystringNoISO code. Default "USD"
titlestringNo-
heightnumberNoPixels. Default 240