33

I am using jqPlot as my charting framework and have numerous charts in my application, primarily line and stacked bar charts.

I now have a requirement to only show the horizonal grid lines on these charts and do not see any options in jqPlot to do this.

There is a showGridline option but that disables the grid lines entirely.

Is it possible to remove only the vertical grid lines in jqPlot and continue to show the horizontal ones?

John Slegers
  • 45,213
  • 22
  • 199
  • 169
nolt2232
  • 2,594
  • 1
  • 22
  • 33

2 Answers2

56

I figured it out. You can apply showGridline to a single axis by doing the following:

axes:{
    xaxis: {
       tickOptions:{
          showGridline: false
       }
    }
}
BlackTigerX
  • 6,006
  • 7
  • 38
  • 48
nolt2232
  • 2,594
  • 1
  • 22
  • 33
8

To remove the grid line on the X-axis :

axes : {
    xaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

To remove the grid line on the Y-axis :

axes : {
    yaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

To remove the grid line on both axes :

axes : {
    xaxis : {
       tickOptions : {
           showGridline : false
       }
    },
    yaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

or

grid : {
    drawGridlines: false
}
Jocari
  • 43
  • 7
Varun Naharia
  • 5,318
  • 10
  • 50
  • 84