Highcharts — how to change line width programmatically and prevent resetting line width?

假装没事ソ 提交于 2019-12-08 07:29:06

问题


I created a line chart, and added a button whose click method make the line thicker (lineWidth 7pt). However, each time I mouse over the line or the legend, the line restore to its original width (which I believe is 2 pt). So I added the following plot options to disable the "hover" function:

    line: {
        states: {
            hover: {
                enabled: false,
            }
        }
    }, 

But it only resolves the issue partially -- after I set lineWidth to 7 pt using the button, the line width will still be reset to its original 2 pt after I mouse over the legend or move mouse across the plotting area.

I have shared my example here. Can anyone help me figure out how to prevent resetting the line width after changing its width to 7 pt?

Thanks in advance!

Alex.


回答1:


You can use

 series.update({
            lineWidth:10
        });

http://jsfiddle.net/QNPYP/2/

http://api.highcharts.com/highcharts#Series.update()



来源:https://stackoverflow.com/questions/17037220/highcharts-how-to-change-line-width-programmatically-and-prevent-resetting-li

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