Venkat Raj
Venkat Raj

Reputation: 219

How to make cursor pointer on mouse hover only on a particular PieChart slice?

I'm working on a PieChart of HighChart to show my user count status.

In the below chart, when I hover on the red color chart slice, then the cursor: pointer needs to enable.

If I hover on the green color chart slice, then I need to disable the cursor totally or set cursor: default.

Can anyone help me to do this?

enter image description here

Upvotes: 1

Views: 1324

Answers (1)

morganfree
morganfree

Reputation: 12472

On a load event you need to set point's cursor to pointer.

Highcharts.chart('container', {
   chart: {
     type: 'pie',
     events: {
       load: function () {
         this.series[0].data[0].graphic.attr({
           cursor: 'pointer'
         });
       }
     }
   },
    series: [{
        data: [90, 10]
    }]
});

example: http://jsfiddle.net/zwwsz2kz/

Upvotes: 1

Related Questions