Atom Report post Posted April 28, 2009 I posted this in another area of the forum and got no response, so I hope someone here can explain. When you go through the process of "creating your first chart" you are given some code to embed which includes a reference to the location of the data. It is this line... param name="Flashvars" value="&dataURL=Data.xml" Now, you can leave this line of code completely out and the chart will run just the same. Or, you can include the line and give the file a different name. My first question is, how does the script know where to get the data for the chart if you don't explicitly tell it? Secondly, how do you go about creating two separate charts from two completely different sets of data on the same web page? Atom Share this post Link to post Share on other sites
Dhruva Report post Posted April 29, 2009 Hello, The chart does need to be pointed to the source data explicitly. That line <param name="FlashVars" value="&dataURL=Data.xml&chartWidth=900&chartHeight=300"> is used to set the size of the chart explicitly, so that browsers which recognize the object tag also renser the chart correctly. For example, IE sometimes does not send the width/height specifications, and that line would prevent any errors. Also, multiple charts can be put on the same page as described in the following documentation: http://www.fusioncharts.com/docs/Contents/MultipleCharts.html Now, this uses just one data surce. Hoever, all one needs to do is make two XML files, and associate them explicitly! It is that simple. Eg- ... myChart1.setDataURL("Data1.xml"); ... myChart2.setDataURL("Data2.xml"); ... etc. I hope this helps! Share this post Link to post Share on other sites
Atom Report post Posted April 29, 2009 Thanks for your reply, but if the data must be pointed to explicitly then why am I able to generate a chart with only this code... <html> <head> <title>My First FusionCharts</title> </head> <body bgcolor="#ffffff"> <center> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="300" id="Column3D" > <param name="movie" value="../FusionCharts/Column3D.swf" /> </object> </center> </body> </html> Share this post Link to post Share on other sites
Atom Report post Posted April 29, 2009 On a related matter, the exact code which runs a chart on my website is thus; <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','600','height','300','src','Line','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Line' ); //end AC code </script> <noscript> <center> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="300"> <param name="movie" value="Line.swf" /> <param name="quality" value="high" /> <embed src="Line.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="300"></embed> </object> </center> </noscript> There is, of course, no reference to a data.xml file here either, but I would also point out that the chart will run just fine without everything between the noscript tags. The purpose of this code is to avoid having to be prompted by IE to allow the code to be generated. You don't seem to mention this anywhere. Comments? Share this post Link to post Share on other sites
Atom Report post Posted April 29, 2009 OK, here's what the code should look like. <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','600','height','300','src','Line','FlashVars','&dataURL=Data.xml','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','Line','FlashVars','&dataURL=Data.xml' ); //end AC code </script> <noscript><center> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="300"> <param name="movie" value="Line.swf" /> <param name="quality" value="high" /> <param name="FlashVars" value="&dataURL=Data.xml&chartWidth=600&chartHeight=300"> <embed src="Line.swf" flashVars="&dataURL=Data.xml&chartWidth=600&chartHeight=300" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="300"></embed> </object> </center> </noscript> At least it works:) Share this post Link to post Share on other sites
Dhruva Report post Posted April 30, 2009 Then it is reading the Data.xml file present in the same folder as the HTML. It is not a method that is recommended. Share this post Link to post Share on other sites
Atom Report post Posted April 30, 2009 What problems can result from having the html and the data in the same folder? And, if having them in the same folder is undesireable, why does it run at all without any file pointing when the data is in the same folder? Share this post Link to post Share on other sites
Dhruva Report post Posted April 30, 2009 No problems will arise out of it, as such. Just that, only one data source can be produced thus, because only one file in a folder may be called Data.xml (In many situations there are more than one charts on a page, drawing data from various sources) Share this post Link to post Share on other sites
Atom Report post Posted April 30, 2009 Ok, I get that, but you still didn't explain why you can generate a chart without pointing to any data file as long as there is a data.xml file in the same folder as the html you are calling the chart from. Share this post Link to post Share on other sites
Dhruva Report post Posted May 4, 2009 Hello, It is designed thus for ease of use in case of simple implementations. Share this post Link to post Share on other sites