Hi,
How to display chart using 'SelectScatter.swf' from MySQL?
Below,are my codes,but its' not working. Please help.
<?php
$link = connectToDB('"db1');
# Create object for Column 3D chart
$FC = new FusionCharts("SelectScatter","550","400");
# Setting Relative Path of chart swf file.
$FC->setSwfPath("FusionCharts/");
# Define chart attributes
$strParam="caption=SelectScatter;xAxisName=Column2;yAxisName=Column1";
# Set chart attributes
$FC->setChartParams($strParam);
$strQuery = "select col1,col2 from table1";
$result = mysql_query($strQuery) or die(mysql_error());
//Pass the SQL Query result to the FusionCharts PHP Class function
//along with field/column names that are storing chart values and corresponding category names
//to set chart data from database
if ($result)
{
$FC->addDataFromDatabase($result, "col2", "col1","","");
}
#mysql_close($link);
# Render the chart
$FC->renderChart();
?>