DS1.2 - Load Data in sequense - see data dropping in
Tags:
Situation:
Step by step solution
- Create an application with 4 datasources and 4 charts assigned to one of the datasources. All Datasources are set to Load in script = true in the properties
- Create a global script variable, lets call it DS_Counter and give it the default value = 1
- In the OnStartup event of the application add the following lines to overlay the charts with the loading bar
CHART_1.showLoadingState("loading...");
CHART_2.showLoadingState("loading...");
CHART_3.showLoadingState("loading...");
CHART_4.showLoadingState("loading..."); - directly after that start the new backgroundprocessing by adding the line
APPLICATION.doBackgroundProcessing(); - Add the following lines of code to the doBackgroundProcessing Event of you application
//the following lines remove the loading bar and loads the data for 1 Datasource per cycle
if (DS_Counter == 1) {
CHART_1.hideLoadingState();
DS_1.loadDataSource();
}
else if (DS_Counter == 2) {
CHART_2.hideLoadingState();
DS_2.loadDataSource();
}
else if (DS_Counter == 3){
CHART_3.hideLoadingState();
DS_3.loadDataSource();
}
else if (DS_Counter == 4){
CHART_4.hideLoadingState();
DS_4.loadDataSource();
}
// the following line loops again into that code to load the next datasource until counter = 4 (last datasource)
if (DS_Counter < 4){
DS_Counter = DS_Counter + 1;
APPLICATION.doBackgroundProcessing();
}
Then start your application and you will see the effect.
Hope you and especially your users will enjoy that way of starting the application.
Dirk