How to create stacked chart conected with database
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



How to create stacked chart conected with... Expand / Collapse
Author
Message
Posted 1/18/2008 12:46:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/20/2008 5:56:13 PM
Posts: 2, Visits: 12
my sql statement like this $strQuery = "SELECT SUM(RAW_AMOUNT) as TotalRawAmount, SUM(FG_AMOUNT) as TotalFGAmount, SUM(WIP) as TotalWIPAmount, UPLOAD_DATE FROM raw_fg_sum GROUP by UPLOAD_DATE";
how to use this sql statement to create stacked 3d chart .
Post #3913
Posted 1/18/2008 6:16:58 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 6:58:37 AM
Posts: 632, Visits: 1,928
hi,

please do this way,

$strQuery = "SELECT SUM(RAW_AMOUNT) as TotalRawAmount, SUM(FG_AMOUNT) as TotalFGAmount, SUM(WIP) as TotalWIPAmount, UPLOAD_DATE FROM raw_fg_sum GROUP by UPLOAD_DATE";

1) 1st create UPLOAD_DATE categories : convert this sql to recordset after fetch etch record and convert it to category

2) 2nd create date wise dataset of TotalRawAmount from recordset

3) 3rd create date wise dataset of TotalWIPAmount from recordset

see this ->

$strQuery = "SELECT SUM(RAW_AMOUNT) as TotalRawAmount, SUM(FG_AMOUNT) as TotalFGAmount, SUM(WIP) as TotalWIPAmount, UPLOAD_DATE FROM raw_fg_sum GROUP by UPLOAD_DATE";

$result=mysql_query($strSQL) or die(mysql_error());

$strXML="<graph>";
$Category="<categories>";
$DataRawAmount="<dataset seriesname='RawAmount' color='FF0000'>";
$DataFGAmount="<dataset seriesname='FGAmount' color='009900' showValues='1' >";
while($oRs=mysql_fetch_array($result)){
   $Category .= "<category name='" . $oRs['UPLOAD_DATE'] . "' />";
   $DataRawAmount .= "<set value='" . $oRs['TotalRawAmount'] . "' />";
   $DataFGAmount .= "<set value='" . $oRs['TotalFGAmount'] . "' />";
}
$Category .= "</categories>";
$DataRawAmount .= "</dataset>";
$DataFGAmount .= "</dataset>";

$strXML .= $Category . $DataRawAmount . $DataFGAmount . "</graph>";

i think it will work

Arindam Baral

Infosoft Global

Thanks,
Arindam

FusionCharts Team
www.fusioncharts.com

Post #3936
« Prev Topic | Next Topic »


Permissions Expand / Collapse

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


Execution: 0.094.