copyWith method
Creates a copy of this data point with the given fields replaced.
Returns a new ChartDataPoint with the same values as this one, except for the fields that are explicitly provided.
Implementation
ChartDataPoint copyWith({
double? x,
double? y,
String? label,
bool? showValue,
}) {
return ChartDataPoint(
x: x ?? this.x,
y: y ?? this.y,
label: label ?? this.label,
showValue: showValue ?? this.showValue,
);
}