$arrData[2][0] = "Product C";
$arrData[3][0] = "Product D";
$arrData[4][0] = "Product E";
$arrData[5][0] = "Product F";
//Store sales data
$arrData[0][1] = 567500;
$arrData[1][1] = 815300;
$arrData[2][1] = 556800;
$arrData[3][1] = 734500;
$arrData[4][1] = 676800;
$arrData[5][1] = 648500;
# Create FusionCharts PHP Class object for single series column3d chart
$FC = new FusionCharts("Column3D", "600", "300");
# Set Relative Path of swf file.
$FC->setSwfPath("../../FusionCharts/");
# store chart attributes in a variable
$strParam = "caption=Sales by Product;numberPrefix=\$;formatNumberScale=0;decimalPrecision=0";
#  Set chart attributes
$FC->setChartParams($strParam);
## call FusionCharts PHP Class Function to add data from the array
$FC->addChartDataFromArray($arrData);
# Render the chart
$FC->renderChart();
?>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
<H5 ><a href='../default.htm'>&laquo; Back to list of examples</a></h5>

</CENTER>
</BODY>
</HTML>
예제 #2
0
//Store sales data for previous year
$arrData[1][0] = "Previous Year";
$arrData[1][1] = "";
// Dataset Parameter
$arrData[1][2] = 547300;
$arrData[1][3] = 584500;
$arrData[1][4] = 754000;
$arrData[1][5] = 456300;
$arrData[1][6] = 754500;
$arrData[1][7] = 437600;
# Create FusionCharts PHP Class object for multiseies column3d chart
$FC = new FusionCharts("MSColumn3D", "600", "300");
# Set Relative Path of swf file.
$FC->setSWFPath("../../FusionCharts/");
# Define chart attributes
$strParam = "caption=Sales by Product;numberPrefix=\$;formatNumberScale=1;rotateValues=1;decimals=0";
# Set chart attributes
$FC->setChartParams($strParam);
# Pass the 2 arrays storing data and category names to
# FusionCharts PHP Class function addChartDataFromArray
$FC->addChartDataFromArray($arrData, $arrCatNames);
# Render the Chart
$FC->renderChart();
?>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
<H5 ><a href='../default.htm'>&laquo; Back to list of examples</a></h5>

</CENTER>
</BODY>
</HTML>
예제 #3
0
$arrData[0][3] = 448000;
$arrData[0][4] = 956000;
$arrData[0][5] = 734000;
//Store Quantity Data
$arrData[1][0] = "Quantity";
$arrData[1][1] = "parentYAxis=S";
// Dataset Parameters
$arrData[1][2] = 576;
$arrData[1][3] = 448;
$arrData[1][4] = 956;
$arrData[1][5] = 734;
# Create combination chart object
$FC = new FusionCharts("MSColumn3DLineDY", "600", "300");
# Set Relative Path of swf file.
$FC->setSWFPath("../../FusionCharts/");
# Define chart attributes
$strParam = "caption=Product A - Sales Details;PYAxisName=Revenue;SYAxisName=Quantity (in Units);numberPrefix=\$;sNumberSuffix= unit";
# Set chart attributes
$FC->setChartParams($strParam);
# Pass the 2 arrays storing data and category names to
# FusionCharts PHP Class function addChartDataFromArray
$FC->addChartDataFromArray($arrData, $arrDataCat);
# Render the chart
$FC->renderChart();
?>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
<H5 ><a href='../default.htm'>&laquo; Back to list of examples</a></h5>
</CENTER>
</BODY>
</HTML>
예제 #4
0
파일: CChart.php 프로젝트: kingsj/zeuscart
 /**
  * Function generates an xml file for generating the chart
  * 
  * @param string $sql
  * @param array $strParam
  * 
  * @return xml
  */
 function generateXML($sql, $strParam)
 {
     include "../includes/FusionCharts_Gen.php";
     $FC = new FusionCharts("Column3D", "900", "500");
     $FC->setChartParams($strParam);
     //$FC->AddColors("FF0000;00FF00;0000FF;FFFF00;FF00FF;FCAAAA");
     $obj = new Bin_Query();
     $arrdata = array();
     if ($obj->executeQuery($sql)) {
         $arr = $obj->records;
         for ($i = 0; $i < count($arr); $i++) {
             $arrdata[$i][0] = $arr[$i]['date'];
             $arrdata[$i][1] = $arr[$i]['total'];
         }
         $FC->addChartDataFromArray($arrdata);
     }
     header('Content-type: text/xml');
     $xml = $FC->getXML();
     header('Content-type: text/html');
     return $xml;
 }