Reputation: 4996
Is it possible to have labels on datetime xAxis that correspond to dataGrouping?
For example I have dataGrouping
such that data are grouped into days / weeks / months / year:
dataGrouping : {
groupPixelWidth: 250,
units : [
['day', [1]], ['week', [1]], ['month', [1]], ['year', [1]]
]
}
There is plenty of options in the highcharts api, but no one seems to achieve the same result as dataGrouping.
The most promising was:
xAxis: {
labels: {
step: 1
}
}
but still there are two weeks between ticks while data is grouped by months.
Upvotes: 1
Views: 1983
Reputation: 4996
I found a solution with tickPositioner
. It is still a workaround, but at least it works.
xAxis: {
tickPositioner: function(){
ticks = this.series[0].processedXData;
ticks.info = this.series[0].currentDataGrouping;
return ticks;
}
}
Upvotes: 1
Reputation: 45079
On thesame level as setting units
you cna set datetimeLebelFormats
, see: http://api.highcharts.com/highstock#plotOptions.area.dataGrouping.dateTimeLabelFormats
Upvotes: 0