Highcharts moving average based on visible data only

孤街浪徒 提交于 2019-12-13 07:56:53

问题


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?


回答1:


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:

  • http://jsfiddle.net/jlbriggs/gejgquxh/


来源:https://stackoverflow.com/questions/28063671/highcharts-moving-average-based-on-visible-data-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!