Caling Instrumentation charts using Javascript
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Caling Instrumentation charts using... Expand / Collapse
Author
Message
Posted 6/8/2007 11:19:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/8/2007 11:27:50 AM
Posts: 2, Visits: 3
I am using Ganttchart in the Instrumentation suite from the enterprise version.

When I try to call the Gantt chart in the instrumentation suite using Javscript, it gives me blank screen with just the border.However, when I try using <object> tag embedding in html approach, it works fine, I use the same XML file as input.

Find below my code snippet.Please help.I put some alerts in code, infact FC_Rendered function also does not get called.

<SCRIPT LANGUAGE="Javascript" SRC="/FusionCharts/FusionCharts.js">
//You need to include the above JS file, if you intend to embed the chart using JavaScript.
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">

function FC_Rendered(DOMId){
   //This method is called whenever a FusionCharts chart is loaded.
   //Check if it's the required chart using ID
   alert('inside FC_Rendered');
   if (DOMId=="ChId1"){
       //Invoke updateChart() method to update chart with new data
       updateChart();
   }
}

function updateChart(){
   //Get reference to chart object using Dom ID "ChId1"
   var chartObj = getChartFromId("ChId1");
   alert('inside update chart'+ chartObj);
   //Update its XML Data URL
   chartObj.setDataURL("/http://OurlocalserverURL?XML=X:/FusionCharts/data/CollabGanttChartNew.xml");
   chartObj.render("chart1div");
}
</SCRIPT>

<BODY>
<div id="chart1div">
   This text is replaced by the chart.
</div>
<script type="text/javascript">
   var chart1 = new FusionCharts("FI2_Gantt.swf", "ChId1", "600", "300", "0", "1");
   alert(chart1);
   //Start Chart with empty data as we'll later update using JavaScript
   chart1.setDataXML("<chart></chart>");
   chart1.render("chart1div");
</script>
</BODY>

Post #1256
Posted 6/8/2007 11:24:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/8/2007 11:27:50 AM
Posts: 2, Visits: 3
The URL in the setDataURL , I just changed the URL for this post(also I have some typos in the URL like '/http' etc) , but trust me it fetches the XML properly.
Post #1257
Posted 6/12/2007 12:06:59 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117, Visits: 498
The Gantt chart is built on v2 platform and as such does not call FC_Rendered function or doesn't support setDataURL/setDataXML method (after rendering).

We will be coming with a v3 of the same in August.

Thanks,
Pallav Nadhani
FusionCharts Team

Post #1271
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 10:31am


Execution: 0.172.