HighCharts:访问缩放的系列数据 [英] HighCharts: Accessing Zoomed Series Data

查看:74
本文介绍了HighCharts:访问缩放的系列数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我缩放HighStock多系列图表(使用导航器或范围选择器),是否有一种方法只能获取缩放系列的point.y数据?

If i zoom an HighStock multi series chart (using either the Navigator or the Range Selector), is there a way to fetch the point.y data only for the zoomed series?

例如,如果我要显示多个分支上的某个时期的销售信息(每个分支按系列绘制),并且如果放大到一周,我想知道分支上一周的销售总额.高库存是否可以访问缩放的数据集?

For example, if I am showing the sales information for a period across multiple branches (each branch plotted as series), and if zoomed to a week, I would like to know the total of sales for the week across the branches. Does highstock provide access to the zoomed dataset?

推荐答案

您可以在每个点上检查isInside标志:

You can check isInside flag on every point:

        redraw: function() {
            var sum = 0;

            Highcharts.each(this.series[0].points, function(point) {
                if (point.isInside) {
                    sum += point.y;
                }
            });
            console.log(sum)
        }

实时演示: http://jsfiddle.net/BlackLabel/7kmzhecy/

这篇关于HighCharts:访问缩放的系列数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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