Flutter Docs
  • Flutter Docs
  • Charts
    • Chart It
    • Guides
      • Cartesian Charts
        • Chart Structuring
          • Grid Styling
          • Axes Styling
          • Axis Labels
        • Charts
          • Bar Chart
            • BarSeries
            • Bar Groups
              • SimpleBar
              • MultiBar
            • Styling
            • Bar Interactions
              • Snap to Bar
              • Fuzziness
      • Radial Charts
        • Charts
          • Pie & Donut Chart
            • PieSeries
            • SliceData
            • Styling
            • Interactions
      • Animations
      • Interactions
    • API Documentation
Powered by GitBook
On this page
  • CartesianGridStyle
  • Class Properties
  1. Charts
  2. Guides
  3. Cartesian Charts
  4. Chart Structuring

Grid Styling

Now that we have learned how to construct our Grid System. Now it's time to style it. For this we will use the chartStylingData property which contains the property gridStyle.

CartesianGridStyle

...
BarChart(
  height: 400,
  chartStructureData: const CartesianChartStructureData(
    xUnitValue: 2,
    yUnitValue: 2,
    maxXValue: 10,
    maxYValue: 10,
  ),
  chartStylingData: CartesianChartStylingData(
    gridStyle: CartesianGridStyle(
      show: true,
      gridLineWidth: 3.0,
      gridLineColor: Colors.white,
    ),
  ),
  data: BarSeries(
    barData: [
      SimpleBar(
        xValue: 1,
        yValue: const BarData(yValue: 2.3),
      ),
    ],
  ),
),

Class Properties

Name
Type
Required
Default Value

show

bool

false

true

gridLineWidth

double

false

0.5

gridLineColor

Color

false

Colors.black45

PreviousChart StructuringNextAxes Styling

Last updated 1 year ago