简体   繁体   English

Highcharts series.data数据类型限制?

[英]Highcharts series.data data type limitations?

Is there a limitation on the "array" method, specifically an amount of data points required to have it work? “数组”方法是否有限制,特别是使它工作所需的数据点数量?

I was using it to display large volumes of data just fine, but when I lowered the amount of points I was plotting, it seemed to break, and only plot one point, with an incorrect X value. 我使用它可以很好地显示大量数据,但是当我降低要绘制的点的数量时,它似乎破裂了,只绘制了一个点,且X值不正确。

When I switched to use the object notation for data points ( { x: new Date(), y: 100 } ) it worked just fine. 当我切换为数据点使用对象表示法( { x: new Date(), y: 100 } )时,它工作得很好。

To clarify, the two notations seem to function differently with different amounts of data. 需要澄清的是,这两种表示法对于不同数量的数据似乎具有不同的功能。 The only thing different between the below example and my production code are the actual dates/values. 下面的示例和我的生产代码之间唯一的不同是实际的日期/值。 Syntax is the same. 语法是一样的。

[[Date.parse(i1), 100], [Date.parse(i2), 100]]

[{ x: Date.parse(i1), y: 100 }, { x: Date.parse(i2), y: 100 }]

http://api.highcharts.com/highcharts#series.data http://api.highcharts.com/highcharts#series.data

The difference, as far as I can say, is that in the array notation, the Date object is not properly interpreted. 据我所知,区别在于数组表示法中的Date对象未正确解释。

Using actual time stamps, both notations work the same. 使用实际的时间戳记,两种表示法的工作原理相同。

Neither method should be affected by too few data points. 两种方法都不应受太少的数据点的影响。

example: 例:

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

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