SimpleCandlestickChart constructor
const
SimpleCandlestickChart({
- Key? key,
- required List<
SimpleCandlestickData> data, - SimpleCandlestickChartMode mode = SimpleCandlestickChartMode.candlestick,
- SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
- double? minValue,
- double? maxValue,
- double height = 280,
- EdgeInsets padding = _defaultPadding,
- Color? bullishColor,
- Color? bearishColor,
- Color? wickColor,
- Color? volumeColor,
- Color? gridColor,
- Color? axisColor,
- Color? activeColor,
- TextStyle? labelStyle,
- TextStyle? valueStyle,
- bool showGrid = true,
- bool showLabels = true,
- bool showValues = false,
- bool showVolume = true,
- bool showTooltip = true,
- bool showActiveCandle = true,
- List<
SimpleChartReferenceLine> referenceLines = const [], - List<
SimpleChartReferenceBand> referenceBands = const [], - int gridLineCount = 4,
- double volumePaneFraction = 0.22,
- double candleWidthFactor = 0.62,
- double? maxCandleWidth,
- double wickWidth = 1.4,
- double bodyRadius = 3,
- SimpleCandlestickValueFormatter? valueFormatter,
- SimpleCandlestickVolumeFormatter? volumeFormatter,
- SimpleCandlestickTapCallback? onCandleTap,
- SimpleCandlestickTooltipBuilder? tooltipBuilder,
- WidgetBuilder? emptyBuilder,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- Duration animationDuration = const Duration(milliseconds: 700),
- 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);