Highcharts - xAxis label for each point
1 answer
The value you need to change is "tickInterval" ( http://api.highcharts.com/highcharts#xAxis.tickInterval ).
Assuming the axis is of type 'datetime' and you want an interval of 1 day and the time is in milliseconds, you will need:
xAxis: {
type: 'datetime',
tickInterval:60*60*24* 1000,
}
If you need even more control over the labels, you can provide the tickPosition array or write the tickPositioner function ( http://api.highcharts.com/highcharts#xAxis.tickPositioner ).
In your case, it might be easier to specify the tickPositions parameter, as you can simply loop over your data getting the x-axis values and create an array of datetime values.
xAxis: {
tickPositions: [0, 1, 2, 4, 8]
},
0
source to share