RadarChart constructor

RadarChart({
  1. Key? key,
  2. required List<double> values,
  3. List<String>? labels,
  4. required double maxValue,
  5. Size size = Size.infinite,
  6. Color fillColor = Colors.black26,
  7. Color strokeColor = Colors.black87,
  8. Color labelColor = Colors.black,
  9. double maxWidth = 200,
  10. double maxHeight = 200,
  11. double textScaleFactor = 0.04,
  12. double? labelWidth,
  13. int? maxLinesForLabels,
  14. bool animate = true,
  15. Duration animationDuration = const Duration(milliseconds: 1500),
  16. Curve curve = Curves.easeIn,
  17. double chartRadiusFactor = 0.8,
})

Creates a chart which plots the values in the form of a spider web or radar.

It takes the @required values parameter which provides the data points (minimum 3 values are required) and @required maxValue which defines the scale of the graph. E.g. The chart contains five levels, if maxValue=10, then each level will have the value '2'.

Example code:

RadarChart(
  values: [1, 2, 4, 7, 9, 0, 6],
  labels: [
    "Label1",
    "Label2",
    "Label3",
    "Label4",
    "Label5",
    "Label6",
    "Label7",
  ],
  maxValue: 10,
  fillColor: Colors.blue,
  chartRadiusFactor: 0.7,
)

Implementation

RadarChart(
    {Key? key,
    required this.values,
    this.labels,
    required this.maxValue,
    this.size = Size.infinite,
    this.fillColor = Colors.black26,
    this.strokeColor = Colors.black87,
    this.labelColor = Colors.black,
    this.maxWidth = 200,
    this.maxHeight = 200,
    this.textScaleFactor = 0.04,
    this.labelWidth,
    this.maxLinesForLabels,
    this.animate = true,
    this.animationDuration = const Duration(milliseconds: 1500),
    this.curve = Curves.easeIn,
    this.chartRadiusFactor = 0.8});