SimpleDonutChart constructor

const SimpleDonutChart({
  1. Key? key,
  2. required List<SimpleDonutChartData> data,
  3. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  4. double height = 250,
  5. EdgeInsets padding = _defaultPadding,
  6. List<Color>? palette,
  7. Color? trackColor,
  8. Color? activeColor,
  9. TextStyle? labelStyle,
  10. TextStyle? valueStyle,
  11. String? centerLabel,
  12. String? centerValue,
  13. bool showLabels = true,
  14. bool showLegend = true,
  15. bool showValues = true,
  16. bool showTooltip = true,
  17. bool showActiveSegment = true,
  18. double innerRadiusFactor = 0.62,
  19. double segmentSpacing = 0.018,
  20. double startAngle = -math.pi / 2,
  21. SimpleDonutValueFormatter? valueFormatter,
  22. SimpleDonutValueFormatter? shareFormatter,
  23. SimpleDonutTapCallback? onSegmentTap,
  24. SimpleDonutTooltipBuilder? tooltipBuilder,
  25. WidgetBuilder? emptyBuilder,
  26. String? semanticLabel,
  27. bool excludeFromSemantics = false,
  28. Duration animationDuration = const Duration(milliseconds: 700),
  29. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleDonutChart({
  super.key,
  required this.data,
  this.style = SimpleBarChartStyle.elegant,
  this.height = 250,
  this.padding = _defaultPadding,
  this.palette,
  this.trackColor,
  this.activeColor,
  this.labelStyle,
  this.valueStyle,
  this.centerLabel,
  this.centerValue,
  this.showLabels = true,
  this.showLegend = true,
  this.showValues = true,
  this.showTooltip = true,
  this.showActiveSegment = true,
  this.innerRadiusFactor = 0.62,
  this.segmentSpacing = 0.018,
  this.startAngle = -math.pi / 2,
  this.valueFormatter,
  this.shareFormatter,
  this.onSegmentTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 700),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(height > 0),
     assert(innerRadiusFactor > 0 && innerRadiusFactor < 0.92),
     assert(segmentSpacing >= 0 && segmentSpacing <= 0.12);