Highcharts moving average based on visible data on

2019-09-21 20:36发布

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条回答
时光不老,我们不散
2楼-- · 2019-09-21 21:04

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:

查看更多
登录 后发表回答