Clear annotations put together


« 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 Javier on 18th June 2013
Hello everybody!

When i put the code corresponding to diferent graphs in the same file, the function "clear annotations" only works for the last graph inserted...

Some of you know why?.. Excuse my ignorance.


************************************************************
Remember clear annotations:

previous-->

  <!-- Don't forget to update these paths -->
 
     <script src="libraries/RGraph.common.core.js" ></script>
     <script src="libraries/RGraph.line.js" ></script>
     <script src="libraries/RGraph.common.dynamic.js"></script>
     <script src="libraries/RGraph.common.context.js" ></script>
     <script src="libraries/RGraph.common.tooltips.js"></script>
     <script src="libraries/RGraph.common.annotate.js" ></script>
     
<script type="text/javascript" src="apis.google.com/js/plusone.js\"></script>

previous <--


<script>

many.char.sets...

  chart.Set('chart.contextmenu', [
                                  ['Show palette', RGraph.Showpalette],
                                  ['Clear', function ()
                                            {
                                             RGraph.Clear(chart.canvas);
                                             RGraph.ClearAnnotations(chart.canvas)
                                             chart.Draw();
                                            }
                                  ]
                                 ]);

</script>

***********************************************************
Posted by RGraph support on 18th June 2013
Hi there,

This page shows it working for both:

www.rgraph.net/fiddle/view/d65e4ccc7a111dd85c05e74ad183b798

Be careful with your canvas references that you're passing to the clear function - ie make sure you're giving it the correct one. Whilst testing I did notice that IE10 isn't saving annotations - but that's a seperate issue.


Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Javier on 20th June 2013
Thanks a lot!!

Add a reply

 




« Back to message list
RGraph on social media