Axis Labels
AxisLabels
...
BarChart(
height: 400,
chartStructureData: const CartesianChartStructureData(
xUnitValue: 1,
yUnitValue: 2,
maxYValue: 10,
),
chartStylingData: CartesianChartStylingData(
axisStyle: CartesianAxisStyle(
axisWidth: 3.0,
axisColor: Colors.white,
tickConfig: AxisTickConfig.forAllAxis(
showTicks: true,
tickLength: 10.0,
tickColor: Colors.white,
),
),
gridStyle: CartesianGridStyle(
show: true,
gridLineWidth: 1.0,
gridLineColor: Colors.white,
),
),
axisLabels: AxisLabels(
left: AxisLabelConfig(
builder: (index, value) => Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Text(
'$index',
style: const TextStyle(color: Colors.white),
),
),
),
bottom: AxisLabelConfig(
builder: (index, value) => Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
'$index',
style: const TextStyle(color: Colors.white),
),
),
),
),
data: BarSeries(
barData: [
SimpleBar(
xValue: 1,
yValue: const BarData(yValue: 2.3),
),
SimpleBar(
xValue: 2,
yValue: const BarData(yValue: 7.2),
),
SimpleBar(
xValue: 3,
yValue: const BarData(yValue: -4.8),
),
],
),
),
AxisLabelConfig


Class Properties
Name
Type
Required
Default Value
Last updated