Highcharts: replace custom button image on hover

后端 未结 1 1397
野性不改
野性不改 2020-12-21 21:08

I added a new custom button, and wanted to change it\'s fill when mouse hover. Can it be done when using symbol image? If not I have another symbol that looks the same but

相关标签:
1条回答
  • 2020-12-21 21:46

    Take look at example: http://jsfiddle.net/AvpDk/

     normalState = new Object();
        normalState.stroke_width = null;
        normalState.stroke = null;
        normalState.fill = null;
        normalState.padding = null;
        normalState.r = null;
    
        hoverState = new Object();
        hoverState = normalState;
        hoverState.fill = 'red';
    
        pressedState = new Object();
        pressedState = normalState;
    
        var custombutton = chart.renderer.button('button', 74, 10, function(){
            alert('aaa');
        },null,hoverState,pressedState).add();
    
    0 讨论(0)
提交回复
热议问题