dakmatt Report post Posted October 20, 2010 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(); ?> Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted October 20, 2010 Hi, Please refer to the link below for the detailed information on the same :- Ref.- http://www.fusioncharts.com/docs/?PHP_DB.html I hope this helps. Share this post Link to post Share on other sites