remember Chart Selection
fun rememberChartSelection(initialIndex: Int? = null, onSelectionChanged: (Int?) -> Unit? = null): ChartSelection(source)
Creates a ChartSelection remembered for the current composition.
Parameters
initial Index
The initially selected index, or null for no initial selection. Changes to this argument during recomposition do not reset the selection.
on Selection Changed
Receives actual selection changes using the latest callback from composition, without recreating the state holder. Assigning the holder's ChartSelection.onSelectionChanged property explicitly overrides this callback.