Sign in to follow this  

Gantt DataURL update problem

Recommended Posts

We have a Gantt chart showing the jobs lined up on a resource that is fed by a external XML document. The problem is the first time that the chart requests the XML document it does not ask for the complete URL.




It is supposed to request something similar to "http://mrc:8012/mrcjava/servlet/MRCCKS.I00571s?slnk=1&DTDEPT=DFT04", but only asks for "http://mrc:8012/mrcjava/servlet/MRCCKS.I00571s?slnk=1" on the initial render. If you tell it to setDataURL() again with the full path again right away it will correctly request the URL.




Here is my code showing that one half of a second after the chart renders the first time you can tell it to update the URL again it will have retrieved the correct XML since it requested the correct URL. I verified this was the problem with Firebug in FireFox.




-- in the head --

   -script type="text/javascript"-

	var objChart;

	var strDataURL = "http://mrc:8012/mrcjava/servlet/MRCCKS.I00571s?slnk=1&DTDEPT=DFT04");

	function refreshPage() { objChart.setDataURL(strDataURL); }


-- In the Body --

-div id="chart1div"--/div-

-script type="text/javascript"-

	objChart = new FusionCharts("../FusionCharts/Gantt.swf", "chart1Id", "100%", "100%", "0", "1");




	setTimeout('refreshPage()', 500); /* Refresh timer. 60000 milliseconds per minute */


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this