This highcharts admin response explains this is not natively possible:
There's no option for using the last date of the month, but you can create your own tickPositioner callback
I've followed the advice, however nothing seems to change regardless of the tickPositioner function! I've created an isolated demo of the issue here. [It's just this example with the tick positioner added.]
In the jsFiddle example you can see my tickPositioner below. I subtract one day (60*60*24*1000
) 15 times (*15
). Fifteen is random just to show there's not affect.
xAxis:{
//LOOK HERE!
tickPositioner:function(){
return _.forEach(this.tickPositions, function(date){
console.log('date',date, new Date(date), new Date(date - 60*60*24*1000*15));
//return date; //uncomment to show orginal dates
return (date - 60*60*24*1000*15);
});
//LOOK HERE!
}
},
Extra notes:
I can tell the tickpositioner is doing something because I can:
- remove the ticks altogether if the function is setup incorrectly
- oddly format the the dates if the dates are incorrect
- not change the date ticks at all if everything is correctly set up.
I suspect there is something going on with the formatting of the dates and minimum tick intervals. In the official highcharts example for tickpositioner there I can see it working, but if you decrease the custom increment they setup you can see a similar issue where there's no affect on the tick positions.