Chart will not draw with hover

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Mike Mantey on 27th May 2014
Hi
I am using 3 charts and have followed the code in your demo examples.
All is working perfectly until I try to add a jQuery hover option.
I have added an hcaption plug in.
If I turn the caption hover off it works perfectly but when on it does not draw anything.
Any ideas
Posted by Richard on 27th May 2014
Check your JavaScript console for an error message. You can add "official" events to the canvas tag - but to add event listeners to elements that are drawn on the canvas you have to use the RGraph options. Eg:

To add a listener to the whole canvas:

$('cvs').hover(function (e)
{
     // In handler
}, function (e)
{
     // Out handler
});

To add a listener to a specific bar (on a bar chart for example):

myBar.$2.onmouseover = function (e, shape)
{
     // 3rd bar clicked
}

More docs on events here:

www.rgraph.net/docs/events-summary.html




Richard

Add a reply




« Back to message list