copyWith method

ChartDataSet copyWith({
  1. ChartDataPoint? dataPoint,
  2. Color? color,
})

Creates a copy of this data set with the given fields replaced.

Returns a new ChartDataSet with the same values as this one, except for the fields that are explicitly provided.

Implementation

ChartDataSet copyWith({ChartDataPoint? dataPoint, Color? color}) {
  return ChartDataSet(dataPoint: dataPoint ?? this.dataPoint, color: color ?? this.color);
}