RadarChart constructor
RadarChart({
- Key? key,
- required List<
double> values, - List<
String> ? labels, - required double maxValue,
- Size size = Size.infinite,
- Color fillColor = Colors.black26,
- Color strokeColor = Colors.black87,
- Color labelColor = Colors.black,
- double maxWidth = 200,
- double maxHeight = 200,
- double textScaleFactor = 0.04,
- double? labelWidth,
- int? maxLinesForLabels,
- bool animate = true,
- Duration animationDuration = const Duration(milliseconds: 1500),
- Curve curve = Curves.easeIn,
- 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});