简体   繁体   English

高图表:同步不同年份同一天的不规则数据系列

[英]Highcharts: Synchronise irregular data series from same day different year

I am comparing temperatures today with the same day last year. 我正在比较今天和去年同一天的温度。 I am retrieving the data from a database (via json) and each series has different times (and timestamps). 我正在从数据库中检索数据(通过json),每个系列都有不同的时间(和时间戳)。 Today's series has datapoints every 10 minutes, last year has data points at 00 and 50 minutes past the hour. 今天的系列每10分钟就有一个数据点,去年则是每小时的00和50分钟。

I cannot get both series to plot accurately on the x axis. 我无法获得两个系列都可以在x轴上准确绘制。

I have played about with the pointInterval for last years data to try to get it right but it only ends up looking approximately right. 过去几年中,我一直在使用pointInterval进行尝试以使其正确,但最终看起来大致正确。

pointInterval: 3600 * 1000 / 2.05

Is there a way to accurately plot points in both series against the x axis? 有没有一种方法可以相对于x轴准确绘制两个系列中的点?

Please see jsfiddle 请参阅jsfiddle

I've managed it. 我已经处理好了 I needed to remove the pointStart and pointInterval from each series, change the year of the 'last year' series to reflect this year and then change to tooltip to show only the hour and minute. 我需要从每个系列中删除pointStart和pointInterval,更改“去年”系列的年份以反映今年,然后更改为工具提示以仅显示小时和分钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM