Highstocks, line missing but data is there

2019-02-20 20:40发布

问题:

I've been playing around with Highstocks for a while now and for some reason one of my lines has disappeared when zooming in, yet it is still visible once zoomed out. It still shows the dot once hovering over it including the data that belongs to it.

Needless to say I'm pretty clueless about what went wrong, so any suggestions would be great.

Zoomed in:

Zoomed out (hard to see but the red line is there)

PS. Website can be found here Skami.net

回答1:

Your series contains doubled values for the same data, for example:

    [1368450000000, null], 
    [1368450000000, 117.200050354004], 
    [1368451800000, null],
    [1368451800000, 117.599990844727],
    [1368453600000, null],
    [1368453600000, 117.710151672363]

Which is not allowed in Highcharts. Remove extra point and will be working fine.



回答2:

I advice to disable dataGrouping

http://api.highcharts.com/highstock#plotOptions.series.dataGrouping.enabled



回答3:

In the specific example, points are not rendered, when having points with a null-value. Example from today (taken from Skami.net):

[1369881000000,131.74983215332],
[1369882800000,null],
[1369884600000,null],
[1369886400000,131.354995727539],
[1369888200000,null],
[1369890000000,null],
[1369891800000,130.976699829102]

The points above will be visible in the tooltip, but not rendered as a graph, because points with a null-value is in between the point with a value.