SimpleCandlestickChart constructor

const SimpleCandlestickChart({
  1. Key? key,
  2. required List<SimpleCandlestickData> data,
  3. SimpleCandlestickChartMode mode = SimpleCandlestickChartMode.candlestick,
  4. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  5. double? minValue,
  6. double? maxValue,
  7. double height = 280,
  8. EdgeInsets padding = _defaultPadding,
  9. Color? bullishColor,
  10. Color? bearishColor,
  11. Color? wickColor,
  12. Color? volumeColor,
  13. Color? gridColor,
  14. Color? axisColor,
  15. Color? activeColor,
  16. TextStyle? labelStyle,
  17. TextStyle? valueStyle,
  18. bool showGrid = true,
  19. bool showLabels = true,
  20. bool showValues = false,
  21. bool showVolume = true,
  22. bool showTooltip = true,
  23. bool showActiveCandle = true,
  24. List<SimpleChartReferenceLine> referenceLines = const [],
  25. List<SimpleChartReferenceBand> referenceBands = const [],
  26. int gridLineCount = 4,
  27. double volumePaneFraction = 0.22,
  28. double candleWidthFactor = 0.62,
  29. double? maxCandleWidth,
  30. double wickWidth = 1.4,
  31. double bodyRadius = 3,
  32. SimpleCandlestickValueFormatter? valueFormatter,
  33. SimpleCandlestickVolumeFormatter? volumeFormatter,
  34. SimpleCandlestickTapCallback? onCandleTap,
  35. SimpleCandlestickTooltipBuilder? tooltipBuilder,
  36. WidgetBuilder? emptyBuilder,
  37. String? semanticLabel,
  38. bool excludeFromSemantics = false,
  39. Duration animationDuration = const Duration(milliseconds: 700),
  40. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleCandlestickChart({
  super.key,
  required this.data,
  this.mode = SimpleCandlestickChartMode.candlestick,
  this.style = SimpleBarChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 280,
  this.padding = _defaultPadding,
  this.bullishColor,
  this.bearishColor,
  this.wickColor,
  this.volumeColor,
  this.gridColor,
  this.axisColor,
  this.activeColor,
  this.labelStyle,
  this.valueStyle,
  this.showGrid = true,
  this.showLabels = true,
  this.showValues = false,
  this.showVolume = true,
  this.showTooltip = true,
  this.showActiveCandle = true,
  this.referenceLines = const [],
  this.referenceBands = const [],
  this.gridLineCount = 4,
  this.volumePaneFraction = 0.22,
  this.candleWidthFactor = 0.62,
  this.maxCandleWidth,
  this.wickWidth = 1.4,
  this.bodyRadius = 3,
  this.valueFormatter,
  this.volumeFormatter,
  this.onCandleTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 700),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(height > 0),
     assert(gridLineCount >= 2),
     assert(volumePaneFraction >= 0 && volumePaneFraction < 0.5),
     assert(candleWidthFactor > 0 && candleWidthFactor <= 1),
     assert(maxCandleWidth == null || maxCandleWidth > 0),
     assert(wickWidth > 0),
     assert(bodyRadius >= 0);