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
-
- Object
- ChartSeries
- BarChartSeries
- 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 tonull. -
clearCategorySpacing(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.categorySpacing tonull. -
clearColor(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.color tonull. -
clearGroupId(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.groupId tonull. -
clearLollipopStyle(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.lollipopStyle tonull. -
clearMetadata(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.metadata tonull. -
clearName(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.name tonull. -
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 tonull. -
clearTrackStyle(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.trackStyle tonull. -
clearUnit(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.unit tonull. -
clearYAxisConfig(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.yAxisConfig tonull. -
clearYAxisId(
) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Clears BarChartSeries.yAxisId tonull. -
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 withvalue. -
withBarGap(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.barGap withvalue. -
withBarStyle(
BarChartStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.barStyle withvalue. -
withBaselineValue(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.baselineValue withvalue. -
withBulletStyle(
BarBulletStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.bulletStyle withvalue. -
withCategorySpacing(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.categorySpacing withvalue. -
withColor(
Color value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.color withvalue. -
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 withvalue. -
withDivergingStyle(
BarDivergingStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.divergingStyle withvalue. -
withErrorBarStyle(
BarErrorBarStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.errorBarStyle withvalue. -
withErrorLowerValues(
List< double?> value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.errorLowerValues withvalue. -
withErrorUpperValues(
List< double?> value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.errorUpperValues withvalue. -
withGroupId(
String value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.groupId withvalue. -
withLabelStyle(
BarLabelStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.labelStyle withvalue. -
withLayoutMode(
BarLayoutMode value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.layoutMode withvalue. -
withLollipopStyle(
BarLollipopStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.lollipopStyle withvalue. -
withMetadata(
Map< String, dynamic> value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.metadata withvalue. -
withMinBarLength(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.minBarLength withvalue. -
withName(
String value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.name withvalue. -
withOrientation(
BarOrientation value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.orientation withvalue. -
withOverlayOffsetFactor(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.overlayOffsetFactor withvalue. -
withOverlayWidthFactor(
double value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.overlayWidthFactor withvalue. -
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 withvalue. -
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 withvalue. -
withShowInLegend(
bool value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.showInLegend withvalue. -
withShowInTrackingTooltip(
bool value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.showInTrackingTooltip withvalue. -
withShowTrackingAxisLabel(
bool value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.showTrackingAxisLabel withvalue. -
withStyle(
SeriesStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.style withvalue. -
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 withvalue. -
withTargetValues(
List< double?> value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.targetValues withvalue. -
withTrackStyle(
BarTrackStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.trackStyle withvalue. -
withUnit(
String value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.unit withvalue. -
withWaterfallStyle(
BarWaterfallStyle value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.waterfallStyle withvalue. -
withWaterfallTotalIndices(
Set< int> value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.waterfallTotalIndices withvalue. -
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 withvalue. -
withYAxisConfig(
YAxisConfig value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.yAxisConfig withvalue. -
withYAxisId(
String value) → BarChartSeries -
Available on BarChartSeries, provided by the BarChartSeriesFluent extension
Replaces BarChartSeries.yAxisId withvalue.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override