Highcharts:显示缺少数据点的线图 [英] Highcharts: Displaying Linechart with missing datapoints

查看:349
本文介绍了Highcharts:显示缺少数据点的线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计算一年中每周的财产平均价值。我想在一个折线图中显示这些信息(x轴是一年的一周,y轴是平均值,不同的线代表不同的属性)。

但对于任何给定的财产,我不一定每年都有一个数据点。如果我没有这样的数据点,我希望我的行可以在我拥有的数据点之间插入。



其他人遇到类似的问题吗?

解决方案

Highcharts并没有真正实现插值。当然,如果你的系列有一个缺失点,它将画出相邻两个之间的界线......但它不是你想发布的计算值。这只是这两个相邻点之间的最短距离。我会预处理您的数据以填写缺失的点,然后用注意:值或可能是颜色计算这些点的计算结果: 值。示例:第二个值来自您的预处理:

  data:[{y:7.0},
{y:6.9,
注:'calculated',
color:'#BF0B23'},
{y:9.5}]
pre>

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 a color: 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆