HTML event to call function to draw chart

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 Arthur on 20th May 2013
some of your demos show that, by using html event, such as onclick, can trigger function in <script> tag.
however, when i try to do so, it doesnt respond at all.

for example, i want to create a button to clear canvas area, referring to your code,
function test(){
RGraph.Clear(document.getElementById("cvs"));}

on html side,
<button onclick="test()"></button>

it doesnt clear the canvas area at all...i missing anything here?
Posted by RGraph support on 20th May 2013
Hi there,

Doesn't appear to be anything wrong with that. You could try this as an alternative - which just "inlines" the code:

<button onclick="canvas = document.getElementById('cvs'); RGraph.Clear(canvas);">
     Click me!
</button>



Richard, RGraph Support

Add a reply




« Back to message list