Can we draw custom legends not based on series in highcharts

和自甴很熟 提交于 2020-12-30 02:55:38

问题


Is it possible to draw custom legends. Actually number of series determine number of legends in highcharts. So is it possible to draw customized number of legends which are not dependent on number of series. Suppose I have two series but I want to draw 10 legends and I want customized actions on click on each legend.


回答1:


Disable default legend and create your own by HTML. Further catch click event on items (by i.e jquery) and reconigse if this element should interact with chart. If yes, then call chart.series[0].show/hide where series[0] is index of available serie and manipulate view.

Docs: - http://api.highcharts.com/highcharts#Series.show



来源:https://stackoverflow.com/questions/32373014/can-we-draw-custom-legends-not-based-on-series-in-highcharts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!