Sign in to follow this  
Guest Rajroop

Can FC periodically check for new data?

Recommended Posts

Is it possible to have a chart check the data periodically to see if it has changed?

 

 

 

If I create a page with several charts, it would be great to be able to have the chart poll the datasource once an hour so that the charts would display up-to-date information. Possible?

 

 

 

Thanks!

Share this post


Link to post
Share on other sites
Guest Rajroop

Hello,

 

 

 

Welcome to the FusionCharts Forum! :D

 

 

 

Yes, this is possible using FusionCharts. You would have to state a time period of refresh interval, in the following part of the code where you are updating the chart with the data:

 

 

 

function updateChart(DOMId){

 

 

 

var chartObj = getChartFromId("chart1Id");

 

 

 

chartObj.setDataURL("NewData.xml");

 

 

 

this.document.frmUpdate.btnUpdate.disabled = true;

 

}

 

 

 

Also, you would need to state the following line of code in place of the above 3rd line of code. This will make sure that the new XML is deployed in the chart and the old XML is not cached!

 

 

 

chartObj.setDataURL("NewData.xml?noCache="+new Date().valueOf());

 

 

 

I hope this helps.

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