Rama Rao Report post Posted February 18, 2012 Hi all, I am trying to display and update HLINEAR GUAGE fusionGadget pointer value. When I am dragging the pointer , the function FC_ChartUpdated is not being called. I have tried using RealtimeUpdateComplete eventListener too. But it displays error 'Object does not support property / method 'setAttribute''..Can you please tell me the reason? Here is my code, <html> <head> <title>FusionGadgets</title> <script language="JavaScript" src="FusionCharts.js"></script> </head> <body bgcolor="#ffffff"> <div id="chartdiv" align="center">FusionGadgets</div> <script type="text/javascript"> var myChart = new FusionCharts("HLinearGauge.swf", "myChartId", "450", "120", "0", "0"); myChart.setDataURL("Data.xml"); myChart.render("chartdiv"); </script> </body> <script> FusionCharts("myChartId").addEventListener("RealtimeUpdateComplete" , myChartListener); function myChartListener(){ alert('Hi.'); } function FC_Rendered(DOMId) { //alert(Math.round(pointerValue)); //Check if DOMId is that of the chart we want if (DOMId=="myChartId"){ //Get reference to the chart var chartRef = FusionCharts(DOMId); //Get the current value var pointerValue = chartRef.getData(1); //You can also use getDataForId method as commented below, to get the pointer value. //var pointerValue = chartRef.getDataForId("CS"); //Update display alert(Math.round(pointerValue)); } } </script> </html> Share this post Link to post Share on other sites
Rama Rao Report post Posted February 18, 2012 Hi, I am getting javascript error here..... var chartReference = FusionCharts("myChartId"); // Object does not support property / method 'setAttribute'' If I am trying to get the reference form the follow way, var chartRef = FusionCharts.items['myChartId']; ..getting another error 'Unable to property /'method 'myChartId': Object is null or undefined Hi all, I am trying to display and update HLINEAR GUAGE fusionGadget pointer value. When I am dragging the pointer , the function FC_ChartUpdated is not being called. I have tried using RealtimeUpdateComplete eventListener too. But it displays error 'Object does not support property / method 'setAttribute''..Can you please tell me the reason? Here is my code, <html> <head> <title>FusionGadgets</title> <script language="JavaScript" src="FusionCharts.js"></script> </head> <body bgcolor="#ffffff"> <div id="chartdiv" align="center">FusionGadgets</div> <script type="text/javascript"> var myChart = new FusionCharts("HLinearGauge.swf", "myChartId", "450", "120", "0", "0"); myChart.setDataURL("Data.xml"); myChart.render("chartdiv"); </script> </body> <script> FusionCharts("myChartId").addEventListener("RealtimeUpdateComplete" , myChartListener); function myChartListener(){ alert('Hi.'); } function FC_Rendered(DOMId) { //alert(Math.round(pointerValue)); //Check if DOMId is that of the chart we want if (DOMId=="myChartId"){ //Get reference to the chart var chartRef = FusionCharts(DOMId); //Get the current value var pointerValue = chartRef.getData(1); //You can also use getDataForId method as commented below, to get the pointer value. //var pointerValue = chartRef.getDataForId("CS"); //Update display alert(Math.round(pointerValue)); } } </script> </html> Share this post Link to post Share on other sites
Rama Rao Report post Posted February 19, 2012 (edited) Hi Guys, Finally,After had been working for several hours,this issue has been resolved.These are the steps which made the issue was resolved... ( By hoping this wil help others who is(will be) suffering from the same issue ). Passing registerWithJs value '1'. var myChart1 = new FusionCharts("HLinearGauge.swf", "myChartId1", "450", "105", "0", "1"); Changed Flash Player Global Security Settings..for more info For more info Chang the FusionCharts.js file to new version. After had made these changes,I encountered with new issue, chartRef.getData(1) gives javascript error (Object does not support the property/method). So then I changed the code for getting chart reference to var chartRef = getChartFromId(DOMId); from var chartRef = FusionCharts(DOMId); Edited February 19, 2012 by Rama Rao Share this post Link to post Share on other sites
Guest Sumedh Report post Posted February 20, 2012 Hi Rama, We appreciate your efforts. And thanks a lot for posting important stuff. This will surely help everyone. Hope you have a great day. Share this post Link to post Share on other sites