BarGradientChartConfig class

Each bar is filled with a vertical gradient. Clicking a bar selects it (highlighted with a brighter gradient + border). Fires onBarTap.

JSON:

{ "type": "barGradient",
  "categories": ["Q1","Q2","Q3","Q4"],
  "gradientStart": "#42A5F5", "gradientEnd": "#0D47A1",
  "series": [{ "data": [120,200,150,80] }] }
Inheritance

Constructors

BarGradientChartConfig({required List<String> categories, required List<Series> series, ChartTheme theme = ChartTheme.light, String gradientStart = '#42A5F5', String gradientEnd = '#0D47A1', double barWidthRatio = 0.6, bool showValues = true, void onBarTap(int index, double value)?, TitlesData? title, ChartTooltip? tooltip, ChartLegend? legend, ChartToolbox? toolbox, GridData? grid})
BarGradientChartConfig.fromJson(Map<String, dynamic> j)
factory

Properties

apiContract ChartApiContract
Shared API contract for all config-driven chart families.
no setterinherited
barWidthRatio double
final
categories List<String>
final
controller ChartController?
finalinherited
gradientEnd String
final
gradientStart String
final
grid GridData?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
legend ChartLegend?
finalinherited
onBarTap → void Function(int index, double value)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
series List<Series>
finalinherited
showValues bool
final
theme ChartTheme
final
title TitlesData?
finalinherited
toolbox ChartToolbox?
finalinherited
tooltip ChartTooltip?
finalinherited
type ChartType
finalinherited
xAxisConfig ChartAxisConfig?
finalinherited
yAxisConfig ChartAxisConfig?
finalinherited

Methods

buildChart() Widget
Method to create the appropriate chart widget
override
getMaxSeriesValue() double
Safe maximum value with 10% headroom.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supportsApiField(String field) bool
inherited
toJson() Map<String, dynamic>
Convert configuration to JSON
override
toString() String
A string representation of this object.
inherited
withController(ChartController controller) BaseChartConfig
Override in concrete configs to return a controller-attached copy.
inherited
withTheme(ChartTheme theme) BaseChartConfig
Override in concrete configs to return a themed copy.
inherited

Operators

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