javascript - Highcharts - change color while hovering over a slice in pie chart -
i have simple pie chart that's green , change slice color red once hover on it. i'm trying api, it's not working...
here's jsfiddle: http://jsfiddle.net/tdkgw/4/
trying via states/hover method, it's not working:
states: { hover: { brightness: 0, color: 'red' } }
any idea on how can have slice you're hovering on (or mouseover) have red fill? , change green once mouseout.
thanks
you can catch mouseover
event on point , set fill, catch mouseout
of series, , "recover color" setting default.
plotoptions: { series: { states: { hover: { enabled: false } }, point: { events: { mouseover: function () { this.graphic.attr({ fill: 'red' }); } } }, events: { mouseout: function () { var serie = this.points; $.each(serie, function (i, e) { this.graphic.attr({ fill: '#cccccc' }); }); } } } },
example: http://jsfiddle.net/r6p7e/6/
Comments
Post a Comment