React-chartjs-2: How to remove the vertical grid ?

Created on 2 Mar 2018  路  5Comments  路  Source: reactchartjs/react-chartjs-2

Hi, I try to remove the vertical line with this code but didn't work. Anyone have some suggestion ? Thanks

Code:

<LineExample options={{
         scaleShowGridLines : false,
                  scaleShowVerticalLines: false,
    }}/>

ss

Most helpful comment

you can remove the vertical lines by setting display: false in inside xAxes property.

options={
  scales: {
    yAxes: [
      { ... },
    ],
    xAxes: [
      {
        gridLines: {
          color: '#aaa',
          borderDash: [1, 3],
        },
        display: false, // this will hide vertical lines
      },
    ],
  },
}

I hope this helps.

All 5 comments

you can remove the vertical lines by setting display: false in inside xAxes property.

options={
  scales: {
    yAxes: [
      { ... },
    ],
    xAxes: [
      {
        gridLines: {
          color: '#aaa',
          borderDash: [1, 3],
        },
        display: false, // this will hide vertical lines
      },
    ],
  },
}

I hope this helps.

Awesome, thankss it worked @jmariomejiap

Perfect, Thanks a lot

Can anybody provide a solution to hide the horizontal lines as well. Thanks in advance!

@utkarsh1510 You can hide the horizontal lines by adding the following to the yAxes property:

gridLines: {
drawOnChartArea: false
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LuizMoreira picture LuizMoreira  路  3Comments

souuu picture souuu  路  4Comments

flavz27 picture flavz27  路  5Comments

Holychung picture Holychung  路  4Comments

DavidSongzw picture DavidSongzw  路  5Comments