SimpleDonutChart constructor
const
SimpleDonutChart({
- Key? key,
- required List<
SimpleDonutChartData> data, - SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
- double height = 250,
- EdgeInsets padding = _defaultPadding,
- List<
Color> ? palette, - Color? trackColor,
- Color? activeColor,
- TextStyle? labelStyle,
- TextStyle? valueStyle,
- String? centerLabel,
- String? centerValue,
- bool showLabels = true,
- bool showLegend = true,
- bool showValues = true,
- bool showTooltip = true,
- bool showActiveSegment = true,
- double innerRadiusFactor = 0.62,
- double segmentSpacing = 0.018,
- double startAngle = -math.pi / 2,
- SimpleDonutValueFormatter? valueFormatter,
- SimpleDonutTapCallback? onSegmentTap,
- SimpleDonutTooltipBuilder? tooltipBuilder,
- WidgetBuilder? emptyBuilder,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- Duration animationDuration = const Duration(milliseconds: 700),
- 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);