Going from single to multi bar
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Going from single to multi bar Expand / Collapse
Author
Message
Posted 3/3/2008 3:09:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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);

?>
Post #4876
Posted 3/4/2008 7:22:01 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts 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
Post #4910
Posted 3/5/2008 7:01:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.
Post #4933
Posted 3/6/2008 12:31:04 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts 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
Post #4971
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:24pm


Execution: 0.063.