Reputation: 41
I have a highchart which shows date label on x-axis, When there are more than 10 dates I'm using a logic of dividing the total dates by 10 and giving the resulting value to step. Because of step value it is not showing the last label. Please help if anybody know's the solution. I tried with showLastLabel and endOnTick but these are not working.
xAxis: {
categories: xcategories,
labels: {
step: getStep(chartJson.length)
}
}
function getStep(jsonLength){
var step =1;
if(jsonLength>=10){
step= (parseInt)(jsonLength/10);
}
return step;;
}
Upvotes: 4
Views: 1437
Reputation: 145
try setting max value for the xAxis. You would have to calculate last step dynamically if your categories are not fixed. Documentation here : https://api.highcharts.com/highcharts/xAxis.max
Upvotes: 0