Highcharts: replace custom button image on hover

2019-01-29 03:44发布

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 has different fill color so it will look like hovering? is there a way to replace the image upon mouseenter/mouseout?

Regards Chanan

1条回答
乱世女痞
2楼-- · 2019-01-29 04:13

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();
查看更多
登录 后发表回答