I was able to get around this limitation by setting the tickinterval so that each of the labels I wanted would be displayed and then using the formatter option, I stripped out any unwanted labels. It's a bit hacky, but I think it's better than hacking the source code, and until a solution is provided within Highcharts, this may be one of the only ways to accomplish this.
My specific problem was: I had an xAxis that needed to show the years 1990, 2015 and 2040 and my data sat between 1990 and 2040. So I set the xAxis options to the following:
Code: Select all
xAxis: {
tickInterval: 5,
labels: {
formatter: function() {
var val = this.value,
desiredLabels = [1990, 2015, 2040];
if ($.inArray(val, desiredLabels) !== -1) {
return val;
}
return '';
}
}
}
By setting the interval to 5, the 1990, 2015 and 2040 labels appeared in the xAxis. I then used the formatter to change the text of any label that I didn't want to show up to an empty string.
I'm sure this logic could be expanded upon to make a more dynamic solution. I hope this is helpful to anybody who runs into this problem in the future.