Skip to content

Legend

Examples

Budget

API Reference

Types come from the public API. A dash indicates no default is documented here.

ChartLegend props

Public source
PropTypeDefaultDescription
showProgressboolean—
showMarkerboolean—
showValueboolean—
showPercentagebooleanprops.showProgress
formatValue(value: number) => stringformatLegendValue
itemClassNamestring''
labelClassNamestring'bk-text-sm bk-font-medium'
valueClassNamestring'bk-text-sm bk-tabular-nums'
renderItem(context: LegendItemContextValue<Item>) => View.Input<M, R>—
idstringRequired
itemsreadonly Item[]Required
hoveredIndexnumber | nullRequired
onHoverChange(index: number | null) => MRequired
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.
titlestring—
titleClassNamestring—
classNamestring—