Javascript 如何从 HighCharts 图例中隐藏系列?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6781110/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 23:09:29 来源:igfitidea点击:
How can I hide series from a HighCharts legend?
提问by Z Jones
I have 4 series in my chart. 2 are visible when the chart loads. 2 are hidden.
我的图表中有 4 个系列。2 在图表加载时可见。2个隐藏。
When the user zooms in, the visibility switches.
当用户放大时,可见性切换。
How can I have a legend that only displays the 2 visible series?
我怎样才能有一个只显示 2 个可见系列的图例?
回答by Igor Dymov
Pass showInLegend
parameter to series you don't want to be visible in legend like:
将showInLegend
参数传递给您不想在图例中可见的系列,例如:
series.showInLegend = false;