stranieroinpatria Report post Posted October 6, 2010 Hi all, I had a problem to use anyone of the api's described in the documentation.The error was always ".... is not a function". I can use just setDataXML and setDataURL. Then I tried to create a very simple page to understand wich is the problem: Include FusionCharts.js v3 and create the function used for clear the chart... <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>PulseFCTry</title> <script type="text/javascript" src="./custom/js/FusionCharts.js"></script> <script type="text/javascript"> function clearChart(){ chart=FusionCharts("fusionLineHOST00M"); chart.clearChart(); } </script> </head> ...after that I create the Chart and rendered it into a div (flag JS to 1) <body> <div id="divprova"></div> <script type="text/javascript"> var myChart = new FusionCharts( "./chart/RealTimeStackedArea.swf" , "fusionLineHOST00M" ,"520","200","0","1"); myChart.setDataXML('<chart dataStreamURL="/ws/fusionLineUpd?idChart=" refreshInterval="5..........etc.......); myChart.render('divprova'); </script> <input type="button" onclick="clearChart()" value="Submit"> </body> The result on click is "chart.clearChart is not a function" Why?? Share this post Link to post Share on other sites
DannyR Report post Posted October 6, 2010 Where are you seeing a clearChart() method in the API? That's a new one on me. Is this what you're looking at? FusionCharts 3.2 JavaScript API Share this post Link to post Share on other sites
DannyR Report post Posted October 6, 2010 Since you're using Firebug, put a watch on your inner variable "chart". You'll see all the methods that are exposed. Share this post Link to post Share on other sites
stranieroinpatria Report post Posted October 6, 2010 I'm interested to the Javascript APIs fo fusionwidget.. http://www.fusioncharts.com/widgets/docs/ DataStreaming charts -> Javascript APIs Am I wrong to think that there isn't Javascript classes for widget and for use those APIs just need FusionCharts.js?(v3) Thank's for your help! Share this post Link to post Share on other sites
stranieroinpatria Report post Posted October 7, 2010 Please, it's extremely important! Share this post Link to post Share on other sites
DannyR Report post Posted October 9, 2010 Ah, I understand what you're asking now. Had to read it a few times. Widgets is a whole different kettle of fish. There is a limited JavaScript API that you can read about here. The methods exposed by FusionCharts.js don't apply. Share this post Link to post Share on other sites
stranieroinpatria Report post Posted October 9, 2010 Ah, I understand what you're asking now. Had to read it a few times. Widgets is a whole different kettle of fish. There is a limited JavaScript API that you can read about here. The methods exposed by FusionCharts.js don't apply. And how I can clear a chart or stop/restart the updates?? How can I use the Javascript APIs for Widget?They are explained in the documentation so I suppose there are some ways to use them.. Share this post Link to post Share on other sites
DannyR Report post Posted October 9, 2010 (edited) Are you running the code on a web server or are you trying to do it from the filesystem? Have you tried using getChartFromID and checking in Firebug to see what methods are exposed? Edited October 9, 2010 by DannyR Share this post Link to post Share on other sites
stranieroinpatria Report post Posted October 9, 2010 Are you running the code on a web server or are you trying to do it from the filesystem? Have you tried using getChartFromID and checking in Firebug to see what methods are exposed? From a apache local server Share this post Link to post Share on other sites