我需要在缩放到1个月时隐藏小时数。
我在这里有一个演示:http://dev.feldsam.cz/unipetrol-stock/
我尝试使用tickPositioner
:
tickPositioner: function(min, max) {
var diff = max - min;
// month
if(diff <= 31 * 24 * 3600 * 1000 && diff > 24 * 3600 * 1000) {
var date = new Date(max);
var minus = date.getHours() * 3600 * 1000;
max = max - minus;
var pos,
tickPositions = [],
tickStart = new Date(date.getFullYear(), date.getMonth(), 1).getTime();
for (pos = tickStart; pos <= max; pos += (5 * 24 * 3600 * 1000)) {
tickPositions.push(pos);
}
tickPositions.info = {
unitName: "day",
higherRanks: {}
};
this.options.ordinal = false;
return tickPositions;
} else {
this.options.ordinal = true;
}
}
但是时间仍在显现。此外,当我从一个月点击到另一个月时,序数仍然是假的。
答案 0 :(得分:0)
您可以在dateTimeLabelFormat http://api.highcharts.com/highstock#xAxis.dateTimeLabelFormats
中定义它