Legend
Examples
Budget
API Reference
Types come from the public API. A dash indicates no default is documented here.
ChartLegend props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
showProgress | boolean | — | |
showMarker | boolean | — | |
showValue | boolean | — | |
showPercentage | boolean | props.showProgress | |
formatValue | (value: number) => string | formatLegendValue | |
itemClassName | string | '' | |
labelClassName | string | 'bk-text-sm bk-font-medium' | |
valueClassName | string | 'bk-text-sm bk-tabular-nums' | |
renderItem | (context: LegendItemContextValue<Item>) => View.Input<M, R> | — | |
id | string | Required | |
items | readonly Item[] | Required | |
hoveredIndex | number | null | Required | |
onHoverChange | (index: number | null) => M | Required | |
onLayoutMeasured | (measurement: typeof LegendMeasurement.Type) => M | — | |
onFocusObserved | (index: number | null) => M | — | |
requestedFocus | { readonly index: number | null; readonly epoch: number; } | — | Change epoch to repeat a focus request for the same index. |
title | string | — | |
titleClassName | string | — | |
className | string | — |