RadarChartData constructor
RadarChartData({
- @required List<
RadarDataSet> ? dataSets, - Color? radarBackgroundColor,
- BorderSide? radarBorderData,
- RadarShape? radarShape,
- GetTitleByIndexFunction? getTitle,
- TextStyle? titleTextStyle,
- double? titlePositionPercentageOffset,
- int? tickCount,
- TextStyle? ticksTextStyle,
- BorderSide? tickBorderData,
- BorderSide? gridBorderData,
- RadarTouchData? radarTouchData,
- FlBorderData? borderData,
RadarChart draws some dataSets
in a radar-shaped chart.
it fills the radar area with radarBackgroundColor
and draws radar border with radarBorderData
then draws a grid over it, you can customize it using gridBorderData
.
it draws some titles based on the number of dataSets
values.
the titles are shown near each radar grid or line.
for changing the titles you can modify the getTitle
field.
and for styling the titles you can use titleTextStyle
.
it draws some ticks. and you can customize the number of ticks by modifying the titleCount
and style the ticks titles with ticksTextStyle
.
for changing the ticks color and border width you can use tickBorderData
.
You can modify radarTouchData
to customize touch behaviors and responses.
Implementation
RadarChartData({
@required List<RadarDataSet>? dataSets,
Color? radarBackgroundColor,
BorderSide? radarBorderData,
RadarShape? radarShape,
this.getTitle,
this.titleTextStyle,
double? titlePositionPercentageOffset,
int? tickCount,
this.ticksTextStyle,
BorderSide? tickBorderData,
BorderSide? gridBorderData,
RadarTouchData? radarTouchData,
super.borderData,
}) : assert(dataSets != null && dataSets.hasEqualDataEntriesLength),
assert(
tickCount == null || tickCount >= 1,
"RadarChart need's at least 1 tick",
),
assert(
titlePositionPercentageOffset == null ||
titlePositionPercentageOffset >= 0 &&
titlePositionPercentageOffset <= 1,
'titlePositionPercentageOffset must be something between 0 and 1 ',
),
dataSets = dataSets ?? const [],
radarBackgroundColor = radarBackgroundColor ?? Colors.transparent,
radarBorderData = radarBorderData ?? const BorderSide(width: 2),
radarShape = radarShape ?? RadarShape.circle,
radarTouchData = radarTouchData ?? RadarTouchData(),
titlePositionPercentageOffset = titlePositionPercentageOffset ?? 0.2,
tickCount = tickCount ?? 1,
tickBorderData = tickBorderData ?? const BorderSide(width: 2),
gridBorderData = gridBorderData ?? const BorderSide(width: 2),
super(
touchData: radarTouchData ?? RadarTouchData(),
);