Hello
I am trying to implement fusioncharts evaluation version with my shopping cart.
Here is the problem :
I have attached a screenshot as well.
I have trying to show "Total Sales by Customer".
I do get the total amount correctly, but it is being displayed multiple times.
Here is the PHP Code im using :
<?php
//Connect to the DB
$link = connectToDB();
//$strXML will be used to store the entire XML document generated
//Generate the chart element
$strXML = "";
//Fetch all factory records
$strQuery = "select * from va_orders";
$result = mysql_query($strQuery) or die(mysql_error());
//Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) {
//Now create a second query to get details for this factory
$strQuery = "select sum(order_total) as OrderTotal from va_orders where user_id=" . $ors['user_id'];
$result2 = mysql_query($strQuery) or die(mysql_error());
$ors2 = mysql_fetch_array($result2);
//Generate
$strXML .= "";
//free the resultset
mysql_free_result($result2);
}
}
mysql_close($link);
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from $strXML
echo renderChart("../FusionCharts/Column3D.swf", "", $strXML, "FactorySum", 600, 300, false, false);
?>