仅基于可见数据的高度图移动平均数 [英] Highcharts moving average based on visible data only

查看:332
本文介绍了仅基于可见数据的高度图移动平均数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个价格时间系列,我写了一个移动平均价格的不同零售商的价格 http:/ / /i.imgur.com/dn3EdM6.png 。目前为止这么好,但我只想看看有形零售商的移动平均数。例如,在这里我只显示了一个商店,但移动平均数是根据它们全部计算的。 http://i.imgur.com/ZpK5gsG.png 是否有可能使它动态化更改?也许重新加载图或什么?

解决方案

我根据上面的评论做了一个例子。



这个例子并没有计算移动平均数 - 为了简单起见,我写了一个简单的函数来计算整体平均值。

这个例子是演示如何在 legendItemClick 上使用它,仅使用可见的系列。



示例:


So, I have a price time series I wrote a moving average for the prices of different retailers http://i.imgur.com/dn3EdM6.png . So far so good, but I want to only see the moving average of the visible retailers. For example, here I have only one shop shown, but the moving average is calculated on all of them. http://i.imgur.com/ZpK5gsG.png Is it possible to make it to dynamically change? Maybe reload the graph or something?

解决方案

I made an example based on my comment above.

This example does not calculate a moving average - I wrote a simple function to calculate the overall average for the sake of simplicity.

The purpose of the example is to demonstrate how to do it on legendItemClick, making use of only the visible series.

Example:

这篇关于仅基于可见数据的高度图移动平均数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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