Highcharts:悬停更换自定义按钮图像(Highcharts: replace custom

2019-07-21 21:01发布

我添加了一个新的自定义按钮,并想改变它的填充时鼠标悬停。 它可以使用符号图像时,可以做什么? 如果不是我有另一个符号,看起来相同,但有不同的填充颜色所以它看起来就像徘徊? 有没有办法更换后的mouseenter /鼠标移出的形象呢?

问候察南

Answer 1:

拿来看的例子: 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();


文章来源: Highcharts: replace custom button image on hover