SimpleWaterfallChart constructor

const SimpleWaterfallChart({
  1. Key? key,
  2. required List<SimpleWaterfallChartData> data,
  3. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  4. double initialValue = 0,
  5. double? minValue,
  6. double? maxValue,
  7. double height = 260,
  8. EdgeInsets padding = _defaultPadding,
  9. Color? increaseColor,
  10. Color? decreaseColor,
  11. Color? totalColor,
  12. Color? connectorColor,
  13. Color? gridColor,
  14. Color? axisColor,
  15. Color? activeBarColor,
  16. TextStyle? labelStyle,
  17. TextStyle? valueStyle,
  18. bool showGrid = true,
  19. bool showValues = true,
  20. bool showConnectors = true,
  21. bool showTooltip = true,
  22. bool showActiveBar = true,
  23. List<SimpleChartReferenceLine> referenceLines = const [],
  24. List<SimpleChartReferenceBand> referenceBands = const [],
  25. int gridLineCount = 4,
  26. double? barRadius,
  27. double? barWidthFactor,
  28. double? maxBarWidth,
  29. bool? useGradient,
  30. SimpleWaterfallValueFormatter? valueFormatter,
  31. SimpleWaterfallValueFormatter? deltaFormatter,
  32. SimpleWaterfallTapCallback? onBarTap,
  33. SimpleWaterfallTooltipBuilder? tooltipBuilder,
  34. WidgetBuilder? emptyBuilder,
  35. String? semanticLabel,
  36. bool excludeFromSemantics = false,
  37. Duration animationDuration = const Duration(milliseconds: 750),
  38. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleWaterfallChart({
  super.key,
  required this.data,
  this.style = SimpleBarChartStyle.elegant,
  this.initialValue = 0,
  this.minValue,
  this.maxValue,
  this.height = 260,
  this.padding = _defaultPadding,
  this.increaseColor,
  this.decreaseColor,
  this.totalColor,
  this.connectorColor,
  this.gridColor,
  this.axisColor,
  this.activeBarColor,
  this.labelStyle,
  this.valueStyle,
  this.showGrid = true,
  this.showValues = true,
  this.showConnectors = 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.deltaFormatter,
  this.onBarTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 750),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(height > 0),
     assert(
       initialValue > double.negativeInfinity &&
           initialValue < double.infinity,
     ),
     assert(gridLineCount >= 2),
     assert(barRadius == null || barRadius >= 0),
     assert(
       barWidthFactor == null || (barWidthFactor > 0 && barWidthFactor <= 1),
     ),
     assert(maxBarWidth == null || maxBarWidth > 0);