Skip to main content
Version: 2.0.0-beta.1

Legends

A Legend describes the elements present on a CartesianChart. There are two built-in implementations: HorizontalLegend and VerticalLegend. These Legends consist of LegendItems.

Create a HorizontalLegend as follows:

rememberHorizontalLegend(
items =
rememberExtraLambda {
add(LegendItem(...))
...
},
...
)

Create a VerticalLegend as follows:

rememberVerticalLegend(
items =
rememberExtraLambda {
add(LegendItem(...))
...
},
...
)

Add a Legend to a CartesianChart as follows:

CartesianChartHost(chart = rememberCartesianChart(legend = ..., ...), ...)