initialSelectedDataIndexes property
final
Data points or series can be selected while performing interaction on the chart. It can also be selected at the initial rendering using this property.
Defaults to []
Widget build(BuildContext context) {
return Container(
child: SfCartesianChart(
initialSelectedDataIndexes: <IndexesModel>[IndexesModel(2,0)],
series: <BarSeries<SalesData, num>>[
BarSeries<SalesData, num>(
selectionSettings: SelectionSettings(
selectedColor: Colors.red,
unselectedColor: Colors.grey
),
),
],
));
}
Implementation
final List<IndexesModel> initialSelectedDataIndexes