Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide axis and gridlines Highcharts

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?

like image 749
alex Avatar asked Jun 04 '12 07:06

alex


People also ask

What is legend in HighCharts?

The legend displays the series in a chart with a predefined symbol and the name of the series. Series can be disabled and enabled from the legend.


2 Answers

For the yAxis you'll also need:

gridLineColor: 'transparent',

like image 22
Zac Morris Avatar answered Sep 29 '22 12:09

Zac Morris


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, } 
like image 133
dgw Avatar answered Sep 29 '22 13:09

dgw