Hide axis and gridlines Highcharts

alex picture alex · Jun 4, 2012 · Viewed 111.8k times · Source

I am trying to hide the axis and gridlines of my Highcharts chart entirely. So far I have tried to set the width of the lines to 0, but it didn't work out.

xAxis: {
  lineWidth: 0,
  minorGridLineWidth: 0,
  lineColor: 'transparent'
}

Is it possible to just globally disable the axis lines/ticks and gridlines to create a "plain" plot?

Answer

dgw picture dgw · Jun 4, 2012

Just add

xAxis: {
   ...  
   lineWidth: 0,
   minorGridLineWidth: 0,
   lineColor: 'transparent',
   ...          
   labels: {
       enabled: false
   },
   minorTickLength: 0,
   tickLength: 0
}

to the xAxis definition.

Since Version 4.1.9 you can simply use the axis attribute visible:

xAxis: {
    visible: false,
}