Highcharts:显示缺少数据点的线图 [英] Highcharts: Displaying Linechart with missing datapoints
问题描述
但对于任何给定的财产,我不一定每年都有一个数据点。如果我没有这样的数据点,我希望我的行可以在我拥有的数据点之间插入。
其他人遇到类似的问题吗?
Highcharts并没有真正实现插值。当然,如果你的系列有一个缺失点,它将画出相邻两个之间的界线......但它不是你想发布的计算值。这只是这两个相邻点之间的最短距离。我会预处理您的数据以填写缺失的点,然后用注意:
值或可能是颜色计算这些点的计算结果:
值。示例:第二个值来自您的预处理:
data:[{y:7.0},
pre>
{y:6.9,
注:'calculated',
color:'#BF0B23'},
{y:9.5}]
I am calculating the average-value of properties for each week of the year. And I want to display these information in a line chart (x-Axis is the week of year, y-Axis the average value and the different lines represent different properties).
But for any given property I do not necessarily have a datapoint for each week of the year. If I do not have such a datapoint I want my line for this property to interpolate between the datapoints I have.
Anyone else run into a similiar issue?
解决方案Highcharts does not really do interpolation. Sure, if your series has a missing point it will draw the line between the adjacent two...but it is not a calculated "value" that you would want to publish. It is just the shortest distance between those two adjacent points. I would pre-process your data to fill in the missing points and then label these points as calculated with either a
Note:
value or maybe acolor:
value. Example where the second value is coming from your pre-processing:data: [{ y: 7.0}, {y: 6.9, Note: 'calculated', color: '#BF0B23'}, {y: 9.5}]
这篇关于Highcharts:显示缺少数据点的线图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!