BarChartSeries class

Bar chart series with configurable geometry and presentation.

Bar WIDTH is construction-only: there is no generated verb for barWidthPercent or barWidthPixels. The constructor asserts barWidthPercent != null || barWidthPixels != null — an OR, so the two are alternatives, not a pair — while copyWith merges each with ?? and exposes no clear flag for either. No fluent verb can therefore express "size in percent INSTEAD of pixels": withBarWidthPercent would leave the pixel width in place and lose to it at render time, and the combined withBarWidth(percent, pixels) this class used to generate required BOTH, which made its percent argument dead in every possible call. Choose the sizing mode at construction, where the alternatives are visible.

id is force-excluded as well: a series id is a JOIN KEY — axes (yAxisId), annotations and artifact documents bind to it — so a verb that rewrites it mid-chain silently detaches the series from everything that references it. Rebuild the series with the id it should carry.

Inheritance
Available extensions
Annotations
  • @ChartSurface.new(excluded: ['id', 'barWidthPercent', 'barWidthPixels'], combinedSetters: [CombinedSetter('withWidthBounds', ['maxWidth', 'minWidth'])])

Constructors

BarChartSeries({required String id, String? name, required List<ChartDataPoint> points, Color? color, bool isXOrdered = false, Map<String, dynamic>? metadata, SeriesStyle? style, List<ChartAnnotation> annotations = const [], String? yAxisId, YAxisConfig? yAxisConfig, String? unit, bool showInLegend = true, bool showTrackingAxisLabel = true, bool showInTrackingTooltip = true, double? barWidthPercent, double? barWidthPixels, double? categorySpacing, double minWidth = 4.0, double maxWidth = 100.0, double barGap = 2.0, BarOrientation orientation = BarOrientation.vertical, BarLayoutMode layoutMode = BarLayoutMode.grouped, String? groupId, BarDivergingRole divergingRole = BarDivergingRole.positive, BarDivergingStyle divergingStyle = const BarDivergingStyle(), double overlayWidthFactor = 1.0, double overlayOffsetFactor = 0.0, double baselineValue = 0.0, List<double?> rangeStartValues = const [], Set<int> waterfallTotalIndices = const {}, BarWaterfallStyle waterfallStyle = const BarWaterfallStyle(), double minBarLength = 0.0, BarChartStyle barStyle = const BarChartStyle(), BarTrackStyle? trackStyle, BarLollipopStyle? lollipopStyle, BarBulletStyle? bulletStyle, List<double?> targetValues = const [], BarTargetMarkerStyle targetMarkerStyle = const BarTargetMarkerStyle(), List<double?> errorLowerValues = const [], List<double?> errorUpperValues = const [], BarErrorBarStyle errorBarStyle = const BarErrorBarStyle(), BarLabelStyle labelStyle = const BarLabelStyle()})
const

Properties

annotations List<ChartAnnotation>
finalinherited
barGap double
Pixel spacing between adjacent series in the same category group.
final
barStyle BarChartStyle
Fill, border, opacity, and corner presentation.
final
barWidthPercent double?
final
barWidthPixels double?
final
baselineValue double
Value-axis baseline from which bars grow.
final
bulletStyle BarBulletStyle?
Optional qualitative ranges that turn each point into a bullet chart.
final
categorySpacing double?
Optional stable category-slot spacing in data units.
final
color Color?
finalinherited
displayName String
no setterinherited
divergingRole BarDivergingRole
Side occupied by this series in BarLayoutMode.divergingStacked.
final
divergingStyle BarDivergingStyle
Shared center-line presentation for a diverging composition.
final
errorBarStyle BarErrorBarStyle
Presentation for uncertainty stems and endpoint caps.
final
errorLowerValues List<double?>
Absolute lower value-axis endpoints aligned by index with points.
final
errorUpperValues List<double?>
Absolute upper value-axis endpoints aligned by index with points.
final
groupId String?
Named composition group for stacked and overlaid layouts.
final
hashCode int
The hash code for this object.
no setteroverride
hasPointOverrides bool

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Returns true if any point has a point style override.
no setter
hasRangeValues bool
Whether at least one point has an explicit range start.
no setter
id String
finalinherited
isEmpty bool
no setterinherited
isNotEmpty bool
no setterinherited
isXOrdered bool
finalinherited
labelStyle BarLabelStyle
Optional labels positioned using the rendered bar rectangle.
final
layoutMode BarLayoutMode
How this series shares its category slot with other bar series.
final
length int
no setterinherited
lollipopStyle BarLollipopStyle?
Optional stem-and-head treatment replacing the filled bar body.
final
maxWidth double
final
metadata Map<String, dynamic>?
finalinherited
minBarLength double
Minimum visible bar length in logical pixels.
final
minWidth double
final
name String?
finalinherited
orientation BarOrientation
Whether categories are arranged horizontally or vertically on screen.
final
overlayOffsetFactor double
Category-axis offset relative to the resolved overlay slot width.
final
overlayWidthFactor double
Width of an overlaid bar relative to its resolved category slot.
final
points List<ChartDataPoint>
finalinherited
rangeStartValues List<double?>
Optional value-axis starts for floating or range bars.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showInLegend bool
Whether automatic legends include this series.
finalinherited
showInTrackingTooltip bool
Whether the tracking tooltip includes this series.
finalinherited
showTrackingAxisLabel bool
Whether tracking mode may expose this series' value on its Y-axis.
finalinherited
style SeriesStyle?
finalinherited
targetMarkerStyle BarTargetMarkerStyle
Presentation for benchmark markers drawn across the bars.
final
targetValues List<double?>
Optional benchmark values aligned by index with points.
final
trackStyle BarTrackStyle?
Optional passive capacity or target track behind each bar.
final
unit String?
Optional unit suffix for value formatting.
finalinherited
waterfallStyle BarWaterfallStyle
Semantic colors and connector presentation for waterfall layout.
final
waterfallTotalIndices Set<int>
Point indices that render the running waterfall total from the baseline.
final
yAxisConfig YAxisConfig?
Inline Y-axis configuration for this series.
finalinherited
yAxisId String?
Optional Y-axis ID for referencing a shared axis in multi-axis mode.
finalinherited

Methods

clearBulletStyle() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.bulletStyle to null.
clearCategorySpacing() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.categorySpacing to null.
clearColor() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.color to null.
clearGroupId() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.groupId to null.
clearLollipopStyle() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.lollipopStyle to null.
clearMetadata() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.metadata to null.
clearName() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.name to null.
clearPointStyles() BarChartSeries

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Clears all point style overrides from the series.
clearStyle() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.style to null.
clearTrackStyle() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.trackStyle to null.
clearUnit() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.unit to null.
clearYAxisConfig() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.yAxisConfig to null.
clearYAxisId() BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Clears BarChartSeries.yAxisId to null.
copyWith({String? id, String? name, bool clearName = false, List<ChartDataPoint>? points, Color? color, bool clearColor = false, SeriesStyle? style, bool clearStyle = false, bool? isXOrdered, Map<String, dynamic>? metadata, bool clearMetadata = false, List<ChartAnnotation>? annotations, String? yAxisId, bool clearYAxisId = false, YAxisConfig? yAxisConfig, bool clearYAxisConfig = false, String? unit, bool clearUnit = false, bool? showInLegend, bool? showTrackingAxisLabel, bool? showInTrackingTooltip, double? barWidthPercent, double? barWidthPixels, double? categorySpacing, bool clearCategorySpacing = false, double? minWidth, double? maxWidth, double? barGap, BarOrientation? orientation, BarLayoutMode? layoutMode, String? groupId, bool clearGroupId = false, BarDivergingRole? divergingRole, BarDivergingStyle? divergingStyle, double? overlayWidthFactor, double? overlayOffsetFactor, double? baselineValue, List<double?>? rangeStartValues, bool clearRangeStartValues = false, Set<int>? waterfallTotalIndices, bool clearWaterfallTotalIndices = false, BarWaterfallStyle? waterfallStyle, double? minBarLength, BarChartStyle? barStyle, BarTrackStyle? trackStyle, bool clearTrackStyle = false, BarLollipopStyle? lollipopStyle, bool clearLollipopStyle = false, BarBulletStyle? bulletStyle, bool clearBulletStyle = false, List<double?>? targetValues, bool clearTargetValues = false, BarTargetMarkerStyle? targetMarkerStyle, List<double?>? errorLowerValues, List<double?>? errorUpperValues, bool clearErrorValues = false, BarErrorBarStyle? errorBarStyle, BarLabelStyle? labelStyle}) BarChartSeries
Creates a copy of this series with specified properties overridden.
override
errorLowerValueFor(int pointIndex) double?
errorUpperValueFor(int pointIndex) double?
isWaterfallTotal(int pointIndex) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rangeStartValueFor(int pointIndex) double
Returns the explicit start for pointIndex, or baselineValue.
targetValueFor(int pointIndex) double?
toJson() Map<String, dynamic>
Serializes this series to a JSON map.
inherited
toString() String
A string representation of this object.
override
updateBarStyle(BarChartStyle update(BarChartStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.barStyle from its current value.
updateDivergingStyle(BarDivergingStyle update(BarDivergingStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.divergingStyle from its current value.
updateErrorBarStyle(BarErrorBarStyle update(BarErrorBarStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.errorBarStyle from its current value.
updateLabelStyle(BarLabelStyle update(BarLabelStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.labelStyle from its current value.
updateTargetMarkerStyle(BarTargetMarkerStyle update(BarTargetMarkerStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.targetMarkerStyle from its current value.
updateWaterfallStyle(BarWaterfallStyle update(BarWaterfallStyle current)) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Rebuilds BarChartSeries.waterfallStyle from its current value.
validateConfiguration() → void
Validates point alignment and composition rules for range values.
validateRangeConfiguration() → void
Backward-compatible validation entry point.
waterfallDisplayValueFor(int pointIndex) double
Value shown for a waterfall label, crosshair, or tooltip.
withAnnotations(List<ChartAnnotation> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.annotations with value.
withBarGap(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.barGap with value.
withBarStyle(BarChartStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.barStyle with value.
withBaselineValue(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.baselineValue with value.
withBulletStyle(BarBulletStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.bulletStyle with value.
withCategorySpacing(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.categorySpacing with value.
withColor(Color value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.color with value.
withColorWhere(bool condition(ChartDataPoint point), Color color) BarChartSeries

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Creates a copy with color applied where condition is true.
withDivergingRole(BarDivergingRole value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.divergingRole with value.
withDivergingStyle(BarDivergingStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.divergingStyle with value.
withErrorBarStyle(BarErrorBarStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.errorBarStyle with value.
withErrorLowerValues(List<double?> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.errorLowerValues with value.
withErrorUpperValues(List<double?> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.errorUpperValues with value.
withGroupId(String value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.groupId with value.
withLabelStyle(BarLabelStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.labelStyle with value.
withLayoutMode(BarLayoutMode value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.layoutMode with value.
withLollipopStyle(BarLollipopStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.lollipopStyle with value.
withMetadata(Map<String, dynamic> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.metadata with value.
withMinBarLength(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.minBarLength with value.
withName(String value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.name with value.
withOrientation(BarOrientation value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.orientation with value.
withOverlayOffsetFactor(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.overlayOffsetFactor with value.
withOverlayWidthFactor(double value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.overlayWidthFactor with value.
withPointColors(Map<int, Color> colors) BarChartSeries

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Creates a copy with point colors at specified indices.
withPoints(List<ChartDataPoint> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.points with value.
withPointStyles(Map<int, PointStyle> overrides) BarChartSeries

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Creates a copy with point styles at specified indices.
withRangeStartValues(List<double?> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.rangeStartValues with value.
withShowInLegend(bool value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.showInLegend with value.
withShowInTrackingTooltip(bool value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.showInTrackingTooltip with value.
withShowTrackingAxisLabel(bool value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.showTrackingAxisLabel with value.
withStyle(SeriesStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.style with value.
withStyleInRange(double xStart, double xEnd, PointStyle style) BarChartSeries

Available on BarChartSeries, provided by the BarPointStyleExtensions extension

Creates a copy with all bars in X-range styled.
withTargetMarkerStyle(BarTargetMarkerStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.targetMarkerStyle with value.
withTargetValues(List<double?> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.targetValues with value.
withTrackStyle(BarTrackStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.trackStyle with value.
withUnit(String value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.unit with value.
withWaterfallStyle(BarWaterfallStyle value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.waterfallStyle with value.
withWaterfallTotalIndices(Set<int> value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.waterfallTotalIndices with value.
withWidthBounds(double maxWidth, double minWidth) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.maxWidth and BarChartSeries.minWidth together.
withXOrdered(bool value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.isXOrdered with value.
withYAxisConfig(YAxisConfig value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.yAxisConfig with value.
withYAxisId(String value) BarChartSeries

Available on BarChartSeries, provided by the BarChartSeriesFluent extension

Replaces BarChartSeries.yAxisId with value.

Operators

operator ==(Object other) bool
The equality operator.
override