|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/5/2008 12:47:41 PM
Posts: 2,
Visits: 7
|
|
I'm new to Fusion Charts and wondered if I could get a bit of help making this multi-series bar graph. How do i adjust my code below to output the COGS and the Sale_Price side by side for each year? Thanks.
include_once ("./Includes/DBConn.php");
// Bar #1
$query = "SELECT SUM(cogs) as totalcogs, SUM(sale_price) as totalsale_price, DATE_FORMAT(orderdate, '%Y') as totalyear FROM spec_registrar WHERE orderdate >= '2005' GROUP BY totalyear ";
$link = connectToDB();
$result = mysql_query($query);
echo mysql_error($link);
$num = mysql_numrows($result);
$i = 0;
$tot = 0;
while ($i < $num) {
$tot = $tot + mysql_result($result, $i, "totalsale_price");
$i ++;
}
$xml = "
$xml .= " showValues='0' numberPrefix = '$' formatNumberScale='0' showBorder='1' rotateYAxisName='1'> ";
$i = 0;
while ($i < $num) {
$xml .= "";
$i++;
}
$xml .= "";
include("./Includes/FusionCharts.php");
echo renderChartHTML("./FusionCharts/Column3D.swf", "", $xml, "Chart", 800, 500, false, true);
?>
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: Yesterday @ 8:20:12 AM
Posts: 2,194,
Visits: 521
|
|
Hi,
You'll need to change your code to get the right SQL and convert it into XML. Please see www.fusioncharts.com/docs > Guide for Web Developers > FusionCharts and PHP
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/5/2008 12:47:41 PM
Posts: 2,
Visits: 7
|
|
Can anyone else provide a solid example of the code to generate a multi-series chart utilizing from my sql statement? Sadly, the documentation doesn't go past a single series where php is involved.
Thanks.
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: Yesterday @ 8:20:12 AM
Posts: 2,194,
Visits: 521
|
|
Hi,
In the download code (Code > PHP), we've multi-series examples. Or you can download our blueprint application which has more advanced multi-series and combination chart examples.
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|