FlGridData constructor
- bool show = true,
- bool drawHorizontalLine = true,
- double? horizontalInterval,
- GetDrawingGridLine getDrawingHorizontalLine = defaultGridLine,
- CheckToShowGrid checkToShowHorizontalLine = showAllGrids,
- bool drawVerticalLine = true,
- double? verticalInterval,
- GetDrawingGridLine getDrawingVerticalLine = defaultGridLine,
- CheckToShowGrid checkToShowVerticalLine = showAllGrids,
Responsible for rendering grid lines behind the content of charts,
show
determines showing or hiding all grids,
AxisChartPainter
draws horizontal lines from left to right of the chart,
with increasing y value, it increases by horizontalInterval
.
Representation of each line determines by getDrawingHorizontalLine
callback,
it gives you a double value (in the y axis), and you should return a FlLine that represents
a horizontal line.
You are allowed to show or hide any horizontal line, using checkToShowHorizontalLine
callback,
it gives you a double value (in the y axis), and you should return a boolean that determines
showing or hiding specified line.
or you can hide all horizontal lines by setting drawHorizontalLine
false.
AxisChartPainter
draws vertical lines from bottom to top of the chart,
with increasing x value, it increases by verticalInterval
.
Representation of each line determines by getDrawingVerticalLine
callback,
it gives you a double value (in the x axis), and you should return a FlLine that represents
a horizontal line.
You are allowed to show or hide any vertical line, using checkToShowVerticalLine
callback,
it gives you a double value (in the x axis), and you should return a boolean that determines
showing or hiding specified line.
or you can hide all vertical lines by setting drawVerticalLine
false.
Implementation
const FlGridData({
this.show = true,
this.drawHorizontalLine = true,
this.horizontalInterval,
this.getDrawingHorizontalLine = defaultGridLine,
this.checkToShowHorizontalLine = showAllGrids,
this.drawVerticalLine = true,
this.verticalInterval,
this.getDrawingVerticalLine = defaultGridLine,
this.checkToShowVerticalLine = showAllGrids,
}) : assert(
horizontalInterval != 0,
"FlGridData.horizontalInterval couldn't be zero",
),
assert(
verticalInterval != 0,
"FlGridData.verticalInterval couldn't be zero",
);