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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -