Highcharts不在点之间绘制线条

时间:2021-07-24 23:42:45

EDIT: The problem was that the intervals were inconsistent. Between this post and this post, it can be fixed fairly easily.

编辑:问题是间隔不一致。在这篇文章和这篇文章之间,它可以很容易地修复。

I am using highcharts to draw a chart, with initial points being provided within the highcharts code, then the rest of the points are pulled in with ajax.

我使用highcharts绘制图表,在highcharts代码中提供初始点,然后使用ajax拉入其余点。

The initial points draw perfectly, and the first few fetched points also work fine, but every few minutes the points will stop being connected on the graph, then it will correct itself, then screw up again.

初始点完美绘制,前几个获取的点也可以正常工作,但每隔几分钟点就会停止在图表上连接,然后它会自行纠正,然后再次搞砸。

Highcharts不在点之间绘制线条

Does anyone have any idea what could be causing this?

有谁知道是什么原因引起的?

3 个解决方案

#1


4  

Had the same problem. My issue was that empty values (not zero, but a no-value-exists type scenario) were empty strings (""). Changing those values to null magically connected the dots for me.

有同样的问题。我的问题是空值(不是零,但是没有值存在的类型场景)是空字符串(“”)。将这些值更改为null会让我神奇地连接点。

#2


0  

You need to ensure that you have null instead of an empty string, etc, but also ensure you have enabled connectNulls in plotOptions as follows:

您需要确保使用null而不是空字符串等,还要确保在plotOptions中启用了connectNulls,如下所示:

plotOptions: {
    series: {
        connectNulls: true
    }
}

See JS FIDDLE

请参阅JS FIDDLE

#3


0  

I had a similar issue, I noticed that some of my 'empty' values were undefined and some were null values. I changed it all to be null and it did the trick.

我有一个类似的问题,我注意到我的一些'空'值是未定义的,有些是空值。我把它全部改为null,它就是诀窍。

#1


4  

Had the same problem. My issue was that empty values (not zero, but a no-value-exists type scenario) were empty strings (""). Changing those values to null magically connected the dots for me.

有同样的问题。我的问题是空值(不是零,但是没有值存在的类型场景)是空字符串(“”)。将这些值更改为null会让我神奇地连接点。

#2


0  

You need to ensure that you have null instead of an empty string, etc, but also ensure you have enabled connectNulls in plotOptions as follows:

您需要确保使用null而不是空字符串等,还要确保在plotOptions中启用了connectNulls,如下所示:

plotOptions: {
    series: {
        connectNulls: true
    }
}

See JS FIDDLE

请参阅JS FIDDLE

#3


0  

I had a similar issue, I noticed that some of my 'empty' values were undefined and some were null values. I changed it all to be null and it did the trick.

我有一个类似的问题,我注意到我的一些'空'值是未定义的,有些是空值。我把它全部改为null,它就是诀窍。