Legend

fun Legend(legendData: List<LegendData>, modifier: Modifier = Modifier, hiddenSet: Set<Int> = emptySet(), onToggle: (Int) -> Unit? = null)(source)

Creates the legend that identifies the colors used for the graph.

When onToggle is provided, each item renders as a Material 3 FilterChip so users can tap to show/hide chart series. This provides proper M3 affordance (selected state styling, ripple, accessibility semantics). When onToggle is null, a compact read-only legend is shown instead.