Legend

A legend, represented by Legendarrow-up-right, describes the elements present on a chart. There are two built-in implementations: HorizontalLegendarrow-up-right and VerticalLegendarrow-up-right. These use LegendItemarrow-up-right instances. Instantiate HorizontalLegend and VerticalLegend via rememberHorizontalLegendarrow-up-right and rememberVerticalLegendarrow-up-right:

rememberCartesianChart(legend = rememberHorizontalLegend(/* ... */), /* ... */)
rememberCartesianChart(legend = rememberVerticalLegend(/* ... */), /* ... */)

Last updated