RadarChartData constructor

RadarChartData({
  1. @required List<RadarDataSet>? dataSets,
  2. Color? radarBackgroundColor,
  3. BorderSide? radarBorderData,
  4. RadarShape? radarShape,
  5. GetTitleByIndexFunction? getTitle,
  6. TextStyle? titleTextStyle,
  7. double? titlePositionPercentageOffset,
  8. int? tickCount,
  9. TextStyle? ticksTextStyle,
  10. BorderSide? tickBorderData,
  11. BorderSide? gridBorderData,
  12. RadarTouchData? radarTouchData,
  13. 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(),
      );