When using multiple charts the clear annotations function doesn't work
« Back to message list
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 2013When 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>
***********************************************************
Hi there,
This page shows it working for both:
www.rgraph.net/fiddle/?viewall
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
Posted by Javier on 20th June 2013This page shows it working for both:
www.rgraph.net/fiddle/?viewall
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
Thanks a lot!!
Add a reply
« Back to message list