Highlighting single segment of the Pie chart on mouseover

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Arun S on 12th March 2013
Hi,

I was trying to highlight the pie on mouse over to it and the code that I wrote is as below:

    pie4.Set('chart.events.mousemove', showPointer);
   
    function showPointer(e, pie)
    {
       e.target.style.cursor ='pointer';
       e.target.style.opacity= '0.6';
       e.stopPropagation();
    }

but this gives opacity to the entire graph not the pie on which mouse is on. I later tried to give pie[0].style.opacity but that didnt work.
Posted by RGraph support on 12th March 2013
Hi there,

Any CSS that you specify will apply to the whole canvas tag - not individual elements that are drawn on the canvas.

You can do highlighting though by using the explode() function - and there's a demo of it here:

dev.rgraph.net/demos/pie11.html

PS Please remember to link to the RGraph website - thanks.

Richard, RGraph support
RGraph - HTML5 and Javascript charts
www.rgraph.net

Add a reply




« Back to message list