&tTText=Chart Title &tBText=Chart Bottom Comment &tLText=Left Comment &tRText=Right Comment &title= ; January; February; March; April; &data1=Series1; 4; 6; 7; 8; |
Chart example:
Code To insert this chart to HTML page:
<object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300"> <param name = movie value = "../zxchart.swf?RefreshPeriod=60&datafile=../samples/samples2.dat&stylefile=../styles/column6.stl"> <param name = quality value = high> <embed src = "../zxchart.swf" quality = high type = "application/x-shockwave-flash"> </embed> </object> |
&tTText=Chart Title &tBText=Chart Bottom Comment &tLText=Left Comment &tRText=Right Comment &title= ; January; February; March; April; &data1=Series1; 4; 6; 7; 8; &data2=Series2; 5; 10; 8; 9; &data3=Series3; 10.5; 7; 9.2; 5; &data4=Series4; 2; 5; 3; 1; |
Chart example:
Code To insert this chart to HTML page:
<object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300"> <param name = movie value = "../zxchart.swf?RefreshPeriod=60&datafile=../samples/samples1.dat&stylefile=../styles/column6.stl"> <param name = quality value = high> <embed src = "../zxchart.swf" quality = high type = "application/x-shockwave-flash"> </embed> </object> |
The script connect to database, execute query and print result.
<?php // Open a connection to a MySQL Server $link = mysql_connect("localhost", "user", "password") or die ("Could not connect to MySQL"); // Select a MySQL database mysql_select_db ("mydatabase") or die ("Could not select database"); // Send a MySQL query $query = "SELECT * FROM mytable"; $result = mysql_query ($query) or die ("Query failed"); // Print Title print "&title=title;Column1;Column2;\n"; // Print Result $i=1; while ($row = mysql_fetch_object($result)) { print "&data".$i."=".$row->field_text.";".$row->field_1.";".$row->field_2.";\r\n"; $i++; } // Close MySQL connection mysql_close($link); ?> |
The script return following content:
&title=title;Column1;Column2; &data1=text1;5.3;75; &data2=text2;4.8;69; |
Code To insert chart to HTML page:
<object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300"> <param name = movie value = "../zxchart.swf?RefreshPeriod=60&datafile=http://localhost/zxchart.php&stylefile=../styles/column6.stl"> <param name = quality value = high> <embed src = "../zxchart.swf" quality = high type = "application/x-shockwave-flash"> </embed> </object> |
Note:
RefreshPeriod=60 - is specify a refresh period (in seconds).
datafile=http://localhost/zxchart.php - is specify a URL to Data File. In these cases Data File is a PHP script.