本文介绍了Highcharts与常见图例点击组合图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个组合图,带有饼图和条形图,现在我的问题是,我想要饼图和条形图都由相同的图例控制,因为状态是相同的...源示例创建一个JS小提琴任何帮助将不胜感激。

I have a combo graphs, with Pie and Bar Graph, now my problem is that I want pie chart and bar graph both controlled from the same legend, as status are the same... source example created a JS fiddle any help would be much appreciated.

事件,然后在饼图中隐藏具有系列索引的元素,如

You can use legendItemClick event and then hide element with series index in pie chart like here http://jsfiddle.net/TV8f4/3/

legendItemClick:function(){

                     var index = this.index,
                         chart = this.chart,
                         series = chart.series,
                         len = series.length,
                         pieSerie = series[len-1];

                     pieSerie.data[index].setVisible();

                 }

这篇关于Highcharts与常见图例点击组合图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 15:43