SimpleGroupedBarChart constructor

const SimpleGroupedBarChart({
  1. Key? key,
  2. required List<String> categories,
  3. required List<SimpleGroupedBarSeries> series,
  4. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  5. double? minValue,
  6. double? maxValue,
  7. double height = 260,
  8. EdgeInsets padding = _defaultPadding,
  9. List<Color>? palette,
  10. Color? barColor,
  11. Color? gridColor,
  12. Color? axisColor,
  13. Color? activeBarColor,
  14. TextStyle? labelStyle,
  15. TextStyle? valueStyle,
  16. bool showGrid = true,
  17. bool showValues = true,
  18. bool showLegend = true,
  19. bool showTooltip = true,
  20. bool showActiveBar = true,
  21. List<SimpleChartReferenceLine> referenceLines = const [],
  22. List<SimpleChartReferenceBand> referenceBands = const [],
  23. int gridLineCount = 4,
  24. double? barRadius,
  25. double? barWidthFactor,
  26. double? maxBarWidth,
  27. bool? useGradient,
  28. SimpleBarValueFormatter? valueFormatter,
  29. SimpleGroupedBarTapCallback? onBarTap,
  30. SimpleGroupedBarTooltipBuilder? tooltipBuilder,
  31. WidgetBuilder? emptyBuilder,
  32. String? semanticLabel,
  33. bool excludeFromSemantics = false,
  34. Duration animationDuration = const Duration(milliseconds: 700),
  35. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleGroupedBarChart({
  super.key,
  required this.categories,
  required this.series,
  this.style = SimpleBarChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 260,
  this.padding = _defaultPadding,
  this.palette,
  this.barColor,
  this.gridColor,
  this.axisColor,
  this.activeBarColor,
  this.labelStyle,
  this.valueStyle,
  this.showGrid = true,
  this.showValues = true,
  this.showLegend = true,
  this.showTooltip = true,
  this.showActiveBar = true,
  this.referenceLines = const [],
  this.referenceBands = const [],
  this.gridLineCount = 4,
  this.barRadius,
  this.barWidthFactor,
  this.maxBarWidth,
  this.useGradient,
  this.valueFormatter,
  this.onBarTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 700),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(gridLineCount >= 2),
     assert(barRadius == null || barRadius >= 0),
     assert(
       barWidthFactor == null || (barWidthFactor > 0 && barWidthFactor <= 1),
     ),
     assert(maxBarWidth == null || maxBarWidth > 0),
     assert(height > 0);