I'd like to show every x-axis label, and you can see it's only showing every other one:
http://jsfiddle.net/f48cjf01/2/
The relevant code:
xAxis: {
categories: _.pluck(_mainData, "number")
, labels: {
rotation: 290
, step: 1 //show every tick regardless of spacing
, align: 'right'
}
}
What do I need to do to show every tick? (I know it may look ugly here considering how little space there is...but I'd like to force it nonetheless)
One solution is to use a tickPositioner
function and specify every single index:
xAxis: {
tickPositioner: function() {
var result = [];
for(i = 0; i < _mainData.length; i++)
result.push(i);
return result;
}
}
See this JSFiddle example. You can remove xAxis.labels.step
when using this.
At first tickInterval
looks easier, but unfortunately doesn't work because of the following note:
If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With