Sequential Load with Javascript
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Sequential Load with Javascript Expand / Collapse
Author
Message
Posted 5/14/2008 11:52:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/27/2008 1:59:23 AM
Posts: 4, Visits: 5
Are there any callback routines or anything to state that the XML has completed loading?

I need to display one chart after another is loaded. There's a total of 12 charts on my page and each represent a significant amount of load on the SQL Server backend. In order to reduce the load, I want to show each chart sequentially.

SetTimeout will not be sufficient as the time will vary significantly. I know Actionscript can communicate directly with Javascript so it would be possible.

Thanks in advance.
Post #6262
Posted 5/17/2008 7:40:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/27/2008 1:59:23 AM
Posts: 4, Visits: 5
A call back from the Flash to say it is finished loading is most likely there, I just want to know how I can access it from the Javascript so I can sequentially display these charts.

Anyone?
Post #6290
Posted 5/18/2008 10:19:35 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001, Visits: 474
We raise 2 events in FusionCharts free:
- Once when the chart is loaded (SWF)
- Once when the chart is rendered (SWF loaded, XML loaded, chart rendered)


Thanks,
Pallav Nadhani
FusionCharts Team
Post #6329
Posted 5/18/2008 10:15:43 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/27/2008 1:59:23 AM
Posts: 4, Visits: 5
and how would I access such?

oChart.onChartRendered() = function () { //do something }

??
Post #6331
Posted 5/23/2008 5:12:28 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001, Visits: 474
Please see http://www.fusioncharts.com/docs/Contents/JS_Overview.html

Thanks,
Pallav Nadhani
FusionCharts Team
Post #6389
Posted 5/27/2008 2:13:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/27/2008 1:59:23 AM
Posts: 4, Visits: 5
Hi folks,

Just in case anyone was interested, this is how I implemented the sequential loading based on the example given. This assumes there to be HTML elements named myid1, myid2, myid3 up to the value of iMaxCharts. I could also have made it check for DOM objects to evaluate the maximum number of charts instead of the iMaxCharts variable.

var iChart = 1;
var iMaxCharts = 3;

function FC_Rendered(){
if (iChart <= iMaxCharts) {
var oChart = new FusionCharts("/Include/Charts/Column3D.swf", "chart_myid" + iChart, "100%", "100%", "0", "1");
oChart.setDataURL("MyXMLDataSource.aspx?chart=" + iChart);
oChart.render("myid" + iChart);
iChart++
}
}
onload = function() {
FC_Rendered()
}
Post #6443
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 11:12am


Execution: 0.031.