|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 12/12/2007 5:13:08 AM
Posts: 2,
Visits: 8
|
|
| Hi friends, I have code to get the flash chart in javascript, like below <script LANGUAGE="Javascript" SRC="http://www.fusioncharts.com/Demos/Blueprint/FusionCharts/FusionCharts.js"></script> function regfun(){ var chart_SalesByYear = new FusionCharts("http://www.fusioncharts.com/Demos/Blueprint/FusionCharts/MSColumn3DLineDY.swf", "SalesByYear", "450", "325", "0", "1"); chart_SalesByYear.setDataXML("<chart caption='Fraud Comparative Report' XAxisName='Monthly' palette='2' animation='1' subcaption='' formatNumberScale='0' numberPrefix='$' showValues='0' seriesNameInToolTip='0'><categories><category label='Mar 2007'/><category label='Apl 2007'/><category label='May 2007'/><category label='Jun 2007'/><category label='Jul 2007'/><category label='Aug 2007'/></categories><dataset seriesname='Billed Business'><set value='119702' link='javaScript%3AupdateCharts%281994%29%3B'/><set value='329702' link='javaScript%3AupdateCharts%211994%29%3B'/><set value='219702' link='javaScript%3AupdateCharts%281994%29%3B'/><set value='219702' link='javaScript%3AupdateCharts%281994%29%3B'/><set value='682796' link='javaScript%3AupdateCharts%281995%29%3B'/><set value='547248' link='javaScript%3AupdateCharts%281996%29%3B'/></dataset><dataset seriesName='Total Fraud' parentYAxis='S'><set value='3381'/><set value='4381'/><set value='5381'/><set value='7381'/><set value='25007'/><set value='18929'/></dataset><styles><definition><style type='font' color='666666' name='CaptionFont' size='15' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles></chart>"); chart_SalesByYear.render("urlContent"); } Please make this as ajax, I want to use the callback mechanism. Thanks in advance....
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 5:38:52 AM
Posts: 884,
Visits: 1,420
|
|
| hi you can use chart_SalesByYear.setDataURL("ajaxServerScript.asp");//or php, or any server side script that return proper chart XML will do the same ajax effect without writing a single line of code of call back in javaScript. Otherwise you can write normal AJAX codes. You can have a look at the ajax sample here : http://www.fusioncharts.com/forum/Topic2576-28-1.aspx
Regards,
Sudipto Choudhury FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 12/12/2007 5:13:08 AM
Posts: 2,
Visits: 8
|
|
| Hi Sudipto, Could you more elaborate the things, Because I am using Servlet in the server side. I have downloaded .js and .swf files in to my server. Now I am able to create charts through javascript. Question: I wanted to create a servlet in the server side such a way that It should return Fusionchart as a html script to the browser (as you said). Then I can able to show the chart with responseText in Ajax. Could you send me the servlet code. Thanks in advance....
|
|
|
|