不使用图例隐藏Highcharts系列 [英] Hiding a Highcharts series without using the legend
问题描述
我需要能够从按钮而不是图例中隐藏Highcharts系列(原因是我需要从一个按钮切换多个组:隐藏Highcharts和jQuery中的_groups_系列:如何获得可接受的性能?,并且出于该帖子中给出的原因,我不能使用 $(chart.series).each )
with jQuery。
以下所有表达式都没有任何影响(我的图表对象被命名为 chart
Chart.series.get(1).hide();
chart.series .get(1).hide();
$(chart.series [1])。hide();
$(chart.series [1])。hide();
$(chart.series [1])。hide();
$(chart.series)[1]。hide();
$(chart.series)[1]。 hide();
有人可以告诉我如何知道它的图表系列索引?谢谢。
这应该是工作的:
chart.seri es [index] .hide()
(来自Simen Echholt评论的 UDP URL)
I need to be able to hide a Highcharts series from a button rather than the legend (the reason is that I need to toggle multiple groups from one button: Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance? and for the reasons given in that post, I cannot use $(chart.series).each()
with jQuery.
None of the following expressions have any effect (my chart object is named chart
):
Chart.series.get(1).hide();
chart.series.get(1).hide();
$(chart.series[1]).hide();
$(chart.series["1"]).hide();
$(chart.series[1]).hide();
$(chart.series)["1"].hide();
$(chart.series)[1].hide();
Can someone please tell me how I can make a chart series hide if I know its index? Thanks.
This should work:
chart.series[index].hide()
(UDP URL from Simen Echholt comment)
这篇关于不使用图例隐藏Highcharts系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!