You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BarChart(
BarChartData(
// read about it in the BarChartData section
),
duration:Duration(milliseconds:150), // Optional
curve:Curves.linear, // Optional
);
Implicit Animations
When you change the chart's state, it animates to the new state internally (using implicit animations). You can control the animation duration and curve using optional duration and curve properties, respectively.
BarChartData
PropName
Description
default value
barGroups
list of BarChartGroupData to show the bar lines together, you can provide one item per group to show normal bar chart
[]
groupsSpace
space between groups, it applies only when the alignment is BarChartAlignment.start, BarChartAlignment.center or BarChartAlignment.end
gets maximum y of y axis, if null, value will be read from the input barGroups (But it is more performant if you provide them)
null
minY
gets minimum y of y axis, if null, value will be read from the input barGroups (But it is more performant if you provide them)
null
baselineY
defines the baseline of y-axis
0
extraLinesData
allows extra horizontal lines to be drawn on the chart. Vertical lines are ignored when used with BarChartData, please see #1149, check ExtraLinesData
ExtraLinesData()
rotationQuarterTurns
Rotates the chart 90 degrees (clockwise) in every quarter turns. This feature works like the RotatedBox widget. You can have horizontal BarChart by changing this value to
0
errorIndicatorData
Holds data for representing an error indicator (you see the error indicators if you provide the toYErrorRange in the BarChartRodData)
Determines the edge rounding of the bar corners, see BorderRadius. When null, it defaults to completely round bars.
null
borderDashArray
Determines wether the border stroke is dashed. It is a circular array of dash offsets and lengths. For example, the array [5, 10] would result in dashes 5 pixels long followed by blank spaces 10 pixels long. The array [5, 10, 5] would result in a 5 pixel dash, a 10 pixel gap, a 5 pixel dash, a 5 pixel gap, a 10 pixel dash, etc.
null
borderSide
Determines the border stroke around of the bar, see BorderSide. When null, it defaults to draw no stroke.