Reputation:
I have drawn a graph using highcharts.js library. I want the xAxis
a little bit customized. I want to show labels in xAxis
but I want to show and hide alternate lables. I mean I want to show labels like 1,3,5 etc. Number 2.4.6 will be drawn but just the label won't be shown for this.
Upvotes: 0
Views: 616
Reputation: 4916
You have an option called step in the x-axis label property, To show only every n th label on the axis, set the step to n.
In your case, Setting the step to 2 (just like below) shows every other label.
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr'],
labels: {
step: 2
}
}
Find an example here
and help yourself with the API here
.
Upvotes: 0