user393267
user393267

Reputation:

Remove the line and tickers on the X axis

Tried to remove the X axis line and tickers from a highcharts chart, but it seems that it won't work.

xAxis: {
    categories:[],
    labels: {enabled: false},
    tickLength: 0,
}

I was able to remove the x axis label and everything else, but no matter what I do, the line at the bottom of the chart, and the various ticks continue to stay there. Strange enough, on the Y axis I don't get this behavior: once I removed the label, everything else disappeared, leaving no line and no ticks.

Is this a bug in Highcharts?

Upvotes: 3

Views: 4594

Answers (1)

user393267
user393267

Reputation:

Found the solution.

While for the Y axis, it is enough to just specify no title, to have everything hidden; for the X axis you need to specify every single option:

xAxis: {
  lineWidth: 0,
   minorGridLineWidth: 0,
   labels: {
       enabled: false
   },
   minorTickLength: 0,
   tickLength: 0
}

This will give the same result that you get on the Y axis, just disabling the label.

Upvotes: 9

Related Questions