MetricChartScaffold
Common scaffold for all metric chart composables. Provides:
An empty-data guard (returns early when isEmpty is true)
A remembered CartesianChartModelProducer passed to content
A trailing Legend strip
Parameters
Whether the chart data is empty — when true, nothing is rendered.
Legend items shown below the chart.
Indices of hidden legend items (toggleable legend).
Callback when a legend item is toggled; when null, a read-only legend is rendered.
Builder lambda receiving the CartesianChartModelProducer and a standard Modifier.weight(1f) suitable for the chart area.
A single CartesianChartModelProducer is created per scaffold instance. Vico forbids swapping the producer attached to a live CartesianChartHost (it throws "A new CartesianChartModelProducer was provided…"), so callers must push new data through CartesianChartModelProducer.runTransaction instead of recreating the producer. Keying the scaffold on external state (e.g. a selected channel) caused exactly that crash, so the previous key parameter was removed.