gpt4 book ai didi

javascript - Highcharts 如何保存选定的图例

转载 作者:行者123 更新时间:2023-12-01 02:53:54 25 4
gpt4 key购买 nike

我正在尝试是否可以从 highcharts 获得回调来说明已选择或取消选择哪个图例项目。然后我可以将其添加到保存的系列数据中,因此当我再次加载 Highcharts 时,它具有保存的选定图例。

最佳答案

查看series.events.legendItemClick ,

legendItemClick: function

Fires when the legend item belonging to the series is clicked. One parameter, event, is passed to the function. The default action is to toggle the visibility of the series. This can be prevented by returning false or calling event.preventDefault().

series.events.hide当系列被隐藏时会被调用。

hide: function

Fires when the series is hidden after chart generation time, either by clicking the legend item or by calling .hide().

将其中之一与 series.visible 结合使用你应该能够做你想做的事。

visible: Boolean

Set the initial visibility of the series.

Defaults to true.

关于javascript - Highcharts 如何保存选定的图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46828220/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com