Sign in to follow this  
joshtheflame

Prefered Method for FusionCharts

Recommended Posts

Dear Experts,

 

 

 

I am developing an application for telecom industry actually its a business intelligence tool in evaluation version. I am dealing with billions of records so therefore I made summary tables and fetching records from there.

 

 

 

Currently I followed "COMBINING FUSION CHARTS, ASP.NET & JAVASCRIPT (dataXML) method" from the help and populate months chart. when you click on any month it shows another chart below and populate all the operators summary of that particular month.

 

 

 

But I am afraid its a very slow process as the blow mentioned code

 

 

 

[script language=javascript" type="text/javascript]

 

//Here, we use a mix of server side script (C#) and JavaScript to

 

//render our data for factory chart in JavaScript variables. We'll later

 

//utilize this data to dynamically plot charts.

 

 

 

//All our data is stored in the data array. From C#, we iterate through

 

//each recordset of data and then store it as nested arrays in this data array.

 

[var data = new Array();]

 

 

 

//Write the data as JavaScript variables here

 

[<%=GetScript()%> ;]

 

[]

 

 

 

 

 

Code behind

 

-----------------

 


public string GetScript()

{



   //Here, we generate the JavaScript array code for the factory data.

   //String to store JavaScript variables

   StringBuilder jsVarString = new StringBuilder();



   //Generate SQL querystring to get all months

   string monthsQuery = "select distinct months, replace(to_char(to_date('01'||months||'2010','DD-MON-YYYY'),'MM'),0,null)  from vw_pre_probe_summary";



   //Sets JavaScript Array Index

   int indexCount = 0;



   //Establish Database Connection

   Database db = DatabaseFactory.CreateDatabase();



   //Create Command object

   DbCommand cmd = db.GetSqlStringCommand(monthsQuery);



   //Execute command and read data in a DataSet

   IDataReader idr = db.ExecuteReader(cmd);



   while (idr.Read())

   {

      //Iterate through each record

      indexCount++;



      //Build JavaScript : Create a new JavaScript Array

      jsVarString.AppendFormat("tt data[{0}] = new Array();", idr[1]);

      jsVarString.Append(Environment.NewLine);



       //Create an SQL Query for the current month



      string detailsql = "select a.years, a.ldi_cd, a.months, b.operator_name, round(sum(a.cer_dur)/60) from vw_pre_probe_summary a, ldioperators b where a.months = " + "'" + idr[0] + "'" + " and a.ldi_cd = b.ldi_cd group by a.years, a.months, a.ldi_cd, b.operator_name";



       //Create Command object

       DbCommand cmdDetail = db.GetSqlStringCommand(detailsql);



       //Execute command and read data in a DataSet

       IDataReader idrDetail = db.ExecuteReader(cmdDetail);



       //Iterate Through records

       while (idrDetail.Read())

       {

           //Build JavaScript : Push Operators Data into JavaScript Array

           jsVarString.AppendFormat("tt data[{0}].push(new Array('{1}',{2}));", idr[1], idrDetail[3], idrDetail[4]);

           jsVarString.Append(Environment.NewLine);

       }

   }

   //Returns JavaScript variables

   return jsVarString.ToString();

}



 

 

 

 

 

loading the whole XML in memory when the page executes and taking the page come up after such a long time. If I follow the above method and If I have 8 to 9 details drill downs I believe I need to query them first will be dead slow....So my question is that if I need to develop quick charts and if I am dealing with billions of records which approach is THE BEST in context of "Efficiency", Speed and performance of the whole application.

 

 

 

Please guide accordingly ..

 

 

 

Thanks

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Could you please try setting the attribute "animation" of the <chart> element to '0'.

Hope this helps. :D

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