FlGridData constructor

const FlGridData({
  1. bool show = true,
  2. bool drawHorizontalLine = true,
  3. double? horizontalInterval,
  4. GetDrawingGridLine getDrawingHorizontalLine = defaultGridLine,
  5. CheckToShowGrid checkToShowHorizontalLine = showAllGrids,
  6. bool drawVerticalLine = true,
  7. double? verticalInterval,
  8. GetDrawingGridLine getDrawingVerticalLine = defaultGridLine,
  9. 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",
      );