SimpleBarChart constructor
const
SimpleBarChart({
- Key? key,
- required List<
SimpleBarChartData> data, - SimpleBarChartOrientation orientation = SimpleBarChartOrientation.vertical,
- SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
- double? minValue,
- double? maxValue,
- double height = 240,
- EdgeInsets? padding,
- Color? barColor,
- Color? gridColor,
- Color? axisColor,
- Color? trackColor,
- Color? activeBarColor,
- TextStyle? labelStyle,
- TextStyle? valueStyle,
- bool showGrid = true,
- bool showValues = true,
- bool showTrack = false,
- bool showTooltip = true,
- bool showActiveBar = true,
- List<
SimpleChartReferenceLine> referenceLines = const [], - List<
SimpleChartReferenceBand> referenceBands = const [], - int gridLineCount = 4,
- double? barRadius,
- double? barWidthFactor,
- double? maxBarWidth,
- bool? useGradient,
- SimpleBarValueFormatter? valueFormatter,
- SimpleBarTapCallback? onBarTap,
- SimpleBarTooltipBuilder? tooltipBuilder,
- WidgetBuilder? emptyBuilder,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- Duration animationDuration = const Duration(milliseconds: 650),
- Curve animationCurve = Curves.easeOutCubic,
Implementation
const SimpleBarChart({
super.key,
required this.data,
this.orientation = SimpleBarChartOrientation.vertical,
this.style = SimpleBarChartStyle.elegant,
this.minValue,
this.maxValue,
this.height = 240,
this.padding,
this.barColor,
this.gridColor,
this.axisColor,
this.trackColor,
this.activeBarColor,
this.labelStyle,
this.valueStyle,
this.showGrid = true,
this.showValues = true,
this.showTrack = false,
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: 650),
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);