- Implementation
- Chart Props
- Selection Config
- Tooltip Config
- Tooltip Point Config
Common Examples
TheChart component renders an ECharts option with Anvil2 styling. Native charts require explicit dimensions because they do not have a CSS container to fill.The chart graphic is hidden from assistive technology. For supported option shapes, Chart exposes the data as a visually hidden list instead. Use accessibilityLabel for its heading; 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. Charts render without ECharts animation.Chart defaults to appearance="light" and variant="monochrome". Set appearance to match the surrounding theme.Tooltips
PassrenderTooltip to provide visual tooltip content. The chart controls placement and keeps a gap from the finger. When the plot is shorter than the tooltip, the gap wins and the tooltip extends outside the chart box. Tooltips are hidden from assistive technology because the data list exposes the values.renderTooltip when the chart does not need a tooltip. Format each value for its product context.Selection
Selection is enabled by default for bars, segments, slices, line points, and area bands. A line drawn without point markers is not selectable. Tapping an area band selects its point at the nearest category. Selecting a mark changes it to the selection color and fades every other mark to 20% opacity. Select the active mark again or tap an empty plot area to clear it. VoiceOver and TalkBack users select the matching value in the data list.Omitselected to let Chart own selection. Use onSelectedChange to respond when the active mark changes. Pass both props to control selection from product state.Set selectedMode: false on a series that must not support selection.Data point taps
PassonDataPointClick to handle activation of a data mark. Pointer users tap the plot; VoiceOver and TalkBack users activate the matching value in the data list. The callback receives the same ChartTooltipInfo a tooltip does: name identifies the category, and points[0] describes the mark. Taps on empty plot area, axis labels, legend entries, and the title are ignored, and a pinch never reports a mark. Omit the callback when the product does not need an additional tap action; values remain interactive for selection. Dataset transforms and other unsupported option shapes produce no list; onDataPointClick is not supported for those shapes.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.