[英]keep right position label x-axis jquery flot
I'm finding about jquery flot
. 我正在寻找有关jquery flot
。
So, i had a problem, that i want to hard fix grid value on x-axis
. 所以,我有一个问题,我想在x-axis
固定网格值。
For examples: 举些例子:
It will update realtime. 它将实时更新。
[4:02, 5:02, 6:02, 7:02, 8:02, 9:02]
after 1 hour, it only change label value and keep right position. [4:02, 5:02, 6:02, 7:02, 8:02, 9:02]
1小时后,它仅更改标签值并保持正确位置。
4:02 become 5:02 and keep right position, 5:02 become 6:02 and keep right position,... 4:02变成5:02并保持正确的位置,5:02变成6:02并保持正确的位置,...
Hope every body can support me, thank you very much. 希望大家能支持我,非常感谢。
Instead of only adding new ticks after each hour you have to generate the complete tick array after every update with something like this (updated fiddle ): 不仅要在每个小时之后添加新的滴答声,您还必须在每次更新后生成完整的滴答声数组,如下所示(更新的小提琴 ):
var first_hour = data_speed_hour[0][0];
options_hour.xaxis.ticks = [
first_hour,
first_hour + 3600000*1,
first_hour + 3600000*2,
first_hour + 3600000*3,
first_hour + 3600000*4,
first_hour + 3600000*5,
first_hour + 3600000*6 //- 600000
];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.