ChartDataPoint constructor

ChartDataPoint({
  1. required dynamic x,
  2. required dynamic y,
  3. String? label,
  4. bool showValue = true,
})

Creates a chart data point.

x and y are required and must be finite numbers or numeric strings. label is optional and can be used for axis labels or tooltips. showValue defaults to true to display the value on the chart.

Throws an AssertionError if x or y are not finite.

Implementation

ChartDataPoint({
  required dynamic x,
  required dynamic y,
  this.label,
  this.showValue = true,
}) : x = _parseValue(x),
     y = _parseValue(y);