PieData constructor

PieData({
  1. required String label,
  2. dynamic value = 0.0,
  3. required Color color,
  4. bool showValue = true,
  5. bool showLabel = true,
  6. double circleSize = 18.0,
})

Creates a pie chart segment.

label must not be empty. value must be a number (int, double) or a numeric string. color is required for rendering. showValue defaults to true to display the value on the chart.

Throws an AssertionError if value is negative or not finite, or if label is empty.

Implementation

PieData({
  required this.label,
  dynamic value = 0.0,
  required this.color,
  this.showValue = true,
  this.showLabel = true,
  this.circleSize = 18.0,
}) : value = _parseValue(value);