我需要隐藏放大到 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;
}
}
但时间仍在显示。另外,当我从一个月点击到另一个月时,序数仍然是错误的。