Highcharts:悬停取代自定义按钮图像 [英] Highcharts: replace custom button image on hover

查看:712
本文介绍了Highcharts:悬停取代自定义按钮图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

问候
察南

推荐答案

以看看例子:的http://的jsfiddle。净/ 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:悬停取代自定义按钮图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆