- Implementation
- Chart Props
- Tooltip Config
- Tooltip Point Config
Common Examples
TheChart component renders an ECharts option with Anvil2 styling. Import EChartsOption from the kit to keep chart configuration on the supported public API.Chart defaults to appearance="light" and variant="monochrome". Set appearance to match the surrounding theme.The chart graphic is hidden from assistive technology. For supported option shapes, Chart exposes the data as a visually hidden table instead. Use accessibilityLabel for its caption; it falls back to option.title.text, then "Chart".Direct category-axis data for bar, line, and area series and direct pie or donut data are supported. Dataset transforms and other option shapes fall back to the accessible label.Tooltips
PassrenderTooltip to provide visual tooltip content. The chart controls placement and keeps the tooltip within the plot. Tooltips are hidden from assistive technology because the table exposes the values.Omit renderTooltip when the chart does not need a tooltip. Format each value for its product context.Data point clicks
PassonDataPointClick to handle activation of a data mark. Pointer users click the plot; keyboard and screen-reader users Tab to the data table and activate a value cell. The callback receives the same ChartTooltipInfo a tooltip does: name identifies the category, and points[0] describes the mark. Clicks on empty plot area, axis labels, legend entries, and the title are ignored. Omit the callback and the table stays read-only, so Tab skips the chart. Dataset transforms and other unsupported option shapes produce no table; onDataPointClick is not supported for those shapes.Hold the reported mark in state to open a Dialog, reveal a detail panel, or navigate. See Stacked bar for a segment-level example.Palette utilities
Usevariant when colors follow the palette’s index order. The variant applies fills, borders, patterns, markers, corner treatments, and hover behavior.chartPalette when an option needs a specific palette entry. chartStepItemStyle converts monochrome and semantic steps into ECharts itemStyle values.itemStyle values override variant styling.