.text{ font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <BODY> <CENTER> <h2><a href="http://www.fusioncharts.com" target="_blank">FusionCharts Free</a> - dataURL and Database</h2> <?php //In this example, we show how to connect FusionCharts to a database //using FusionCharts PHP class. In our other examples, we've used dataXML method //where the XML is generated in the same page as chart. Here, the XML data //for the chart would be generated in PieData.php. //For the sake of ease, we've used an MySQL databases containing two tables. //the php script in piedata.asp interacts with the database, //converts the data into proper XML form and finally //relays XML data document to the chart $strDataURL = "PieData.php"; //Create the chart - Pie 3D Chart with dataURL as strDataURL echo renderChart("../../FusionCharts/FCF_Pie3D.swf", $strDataURL, "", "FactorySum", 650, 450, false, false); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
public function index() { $chart_type = 'line'; $chart_width = 450; $chart_height = 250; // Store Name of Products $arrData[0][1] = "Product A"; $arrData[1][1] = "Product B"; $arrData[2][1] = "Product C"; //Store sales data $arrData[0][2] = 567500; $arrData[1][2] = 615300; $arrData[2][2] = 556800; //Initialize <chart> element $strXML = "<chart caption='Sales by Product' numberPrefix='\$' formatNumberScale='0' theme='fint'>"; //Convert data to XML and append foreach ($arrData as $arSubData) { $strXML .= "<set label='" . $arSubData[1] . "' value='" . $arSubData[2] . "' />"; } //Close <chart> element $strXML .= "</chart>"; $data['chart'] = renderChart($chart_type, '', $strXML, 'div', $chart_width, $chart_height, false, false); $this->load->view('fusion_firstchart', $data); // $data['chart'] = renderChart("column3d", "", $strXML, "myChart", 600, 300); // $this->load->view('fusion_v',$data) ; }
function index() { $this->open(); # config pagination $config['base_url'] = base_url() . 'index.php/dashboard/index/'; $this->pagination->initialize($config); # end config pagination $year = date('Y'); $db['setoran_awal'] = $this->dashboard->setoran_awal($year); $data['setoran_awal'] = $db['setoran_awal']->row()->setoran_awal; $db['setoran_lunas'] = $this->dashboard->setoran_lunas($year); $data['setoran_lunas'] = $db['setoran_lunas']->row()->setoran_lunas; $db['setoran_lunas_tunda'] = $this->dashboard->setoran_lunas_tunda($year); $data['setoran_lunas_tunda'] = $db['setoran_lunas_tunda']->row()->setoran_lunas_tunda; $db['pembatalan_setoran_awal'] = $this->dashboard->pembatalan_setoran_awal($year); $data['pembatalan_setoran_awal'] = $db['pembatalan_setoran_awal']->row()->pembatalan_setoran_awal; $db['pembatalan_setoran_lunas'] = $this->dashboard->pembatalan_setoran_lunas($year); $data['pembatalan_setoran_lunas'] = $db['pembatalan_setoran_lunas']->row()->pembatalan_setoran_lunas; # load view $this->load->helper(array('url', 'fusioncharts')); $graph_swfFile = base_url() . 'asset/admin/js/chart/flash/Column3D.swf'; $graph_caption = 'Chart'; $graph_numberPrefix = 'Rp.'; $graph_title = 'Penjualan Produk'; $graph_width = 600; $graph_height = 300; // Store Name of Products $arrData[0][1] = "S Awal"; $arrData[1][1] = "S Lunas"; //pendapatan $arrData[2][1] = "S Lunas Tunda"; //pendapatan $arrData[3][1] = "Batal S Awal"; //pengeluaran $arrData[4][1] = "Batal S Lunas"; //Store sales data $arrData[0][2] = $data['setoran_awal']; $arrData[1][2] = $data['setoran_lunas']; $arrData[2][2] = $data['setoran_lunas_tunda']; $arrData[3][2] = $data['pembatalan_setoran_awal']; $arrData[4][2] = $data['pembatalan_setoran_lunas']; $strXML = "<graph caption='" . $graph_caption . "' numberPrefix='" . $graph_numberPrefix . "' formatNumberScale='0' decimalPrecision='0'>"; //Convert data to XML and append foreach ($arrData as $arSubData) { $strXML .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />"; } //Close <chart> element $strXML .= "</graph>"; $data['graph'] = renderChart($graph_swfFile, $graph_title, $strXML, "div", $graph_width, $graph_height); //$this->load->view('chart_view',$data) ; $this->load->view('dashboard/dashboard', $data); $this->close(); }
public function index() { $d['judul'] = 'laporan'; $d['judul_halaman'] = 'Laporan'; $tahun = date("Y"); $dataXML1 = $this->get_jumlah_berita(); $d['caption_berita'] = "Jumlah Berita Per Bidang Fokus Tahun " . $tahun; $d['graph_berita'] = renderChart(base_url() . "assets/plugin/FusionCharts/Column3D.swf ", "", $dataXML1, "StatistikBerita", '100%', 400, 0, 1); $dataXML2 = $this->get_jumlah_artikel(); $d['caption_artikel'] = "Jumlah Artikel berdasarkan Klasifikasi Tahun " . $tahun; $d['graph_artikel'] = renderChart(base_url() . "assets/plugin/FusionCharts/Column3D.swf ", "", $dataXML2, "StatistikArtikelKlasifikasi", '100%', 400, 0, 1); $d['content'] = $this->load->view('v_laporan', $d, true); $this->load->view('cari', $d); }
public function index() { $d['judul'] = 'trend'; $d['judul_halaman'] = 'Trend'; $d['all_tahun'] = $this->app_model->get_all_tahun(); $d['all_kategori'] = $this->app_model->get_all_kategori(); $data['main_content'] = 'books_view'; $d['data_trend'] = $this->app_model->get_trend_penelitian(); $tahun = date("Y"); /* Chart Trend Inovasi Per Bidang Fokus */ $dataXML1 = $this->get_trend_per_section(); $d['caption_berita'] = "Trend Inovasi Per Bidang Fokus Tahun " . $tahun; $d['graph_berita'] = renderChart(base_url() . "assets/plugin/FusionCharts/MSLine.swf ", "", $dataXML1, "TrendPerSection", '100%', 300, 0, 1); /* Top Keyword */ $t = '2011'; $d['top_keyword'] = $this->app_model->get_top_keyword($t); print_r($d['top_keyword']); $d['content'] = $this->load->view('trend', $d, true); $this->load->view('cari', $d); }
$totalcuotameta=0; $totalcuotamin=0; $animateChart = $_GET['animate']; //Set default value of 1 if ($animateChart=="") $animateChart = "1"; $ruta = "Data/"; $name_file = $claveagt.".xml"; $file = fopen($ruta.$name_file,"w+"); fwrite ($file,$strXML); fclose($file); echo renderChart("../../Charts/MSLine.swf", $ruta.$name_file, "", $myrowusr[claveagente], 600, 300, false, false); } ?> <!--<div id="chartContainer">FusionCharts XT will load here!</div> <script type="text/javascript"> var xml = <?php echo $ruta.$name_file ?> var myChart = new FusionCharts( "Column3D", "myChartId", "600", "300" ); myChart.setXMLUrl("Data\msanchez.xml"); myChart.render("chartContainer"); </script>--> </fieldset> <?php echo $strTabla;
<style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <BODY> <CENTER> <h2><a href="http://www.fusioncharts.com" target="_blank">FusionCharts Free</a> Examples</h2> <h4>Simple Column 3D Chart using dataURL method</h4> <?php //This page demonstrates the ease of generating charts using FusionCharts PHP Class. //For this chart, we've used a Data.php which uses FusionCharts PHP Class (contained in /Data/ folder) //This file will generate the chart XML and pass it to the chart //We will use FusionCharts PHP function - renderChart() to render the chart usin the XML //For a head-start, we've kept this example very simple. //Create the chart - Column 3D Chart with data from Data/Data.xml echo renderChart("../../FusionCharts/FCF_Column3D.swf", "Data/Data.php", "", "myFirst", 600, 300, false, false); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
public function capaian_hasil() { // $sess = $this->session->userdata; // pre($sess); $this->data['title'] = 'Dashboard'; $this->load->model('mlib'); $this->load->model('msatker'); //GET DEPT LIST $this->data['unitList'] = $this->msatker->getUnit(); //GET UNIT LIST $this->data['deptList'] = $this->msatker->getDept(); //GET PROGRAM LIST $getProg = $this->msatker->getAllProgram(); foreach ($getProg as $pIdx => $pVal) { $program[] = $pVal['kdprogram']; } $this->data['program'] = $program; //GET THANG LIST $getThang = $this->msatker->getAllThang(); foreach ($getThang as $index => $value) { $thang[] = $value['thang']; } $this->data['thang'] = $thang; $post = $this->input->post(); //parameter for get report $nmSatuan = ""; if ($post['dept']) { $kdDept = $post['dept']; $this->data['kdDept'] = $post['dept']; $resDeptName = $this->msatker->getDept($kdDept); $this->data['deptName'] = $resDeptName[0]['nmdept']; $nmSatuan = $this->data['deptName']; } else { if ($this->_kddept) { $kdDept = $this->_kddept; $this->data['kdDept'] = $this->_kddept; $resDeptName = $this->msatker->getDept($kdDept); $this->data['deptName'] = $resDeptName[0]['nmdept']; $nmSatuan = $this->data['deptName']; } else { $kdDept = NULL; } } if ($post['unit']) { $kdUnit = $post['unit']; $this->data['kdUnit'] = $post['unit']; $resUnitName = $this->msatker->getUnit($kdUnit); $this->data['unitName'] = $resUnitName[0]['nmunit']; $nmSatuan = $this->data['unitName']; } else { if ($this->_kdunit) { $kdUnit = $this->_kdunit; $this->data['kdUnit'] = $this->_kdunit; $resUnitName = $this->msatker->getUnit($kdUnit); $this->data['unitName'] = $resUnitName[0]['nmunit']; $nmSatuan = $this->data['unitName']; } else { $kdUnit = NULL; } } if ($this->_iskl) { $iskl = TRUE; } else { $iskl = NULL; } if ($post['kdprogram']) { $kdProgram = $post['kdprogram']; $this->data['kdprogram'] = $post['kdprogram']; $nmSatuan = "Program Dengan Kode " . $post['kdprogram']; } else { $kdProgram = NULL; } if ($post['thang']) { $thangVal = $post['thang']; } else { $thangVal = substr($this->data['now'], 0, 4) - 1; } $this->data['thangVal'] = $thangVal; $this->load->helper(array('url', 'fusioncharts')); //Convert data to XML and append /* P */ $graph_swfFile = base_url() . 'public/charts/Line.swf'; $graph_caption = 'Grafik Capaian Hasil ' . $nmSatuan . ' Tahun Anggaran ' . $thangVal; $graph_numberPrefix = ''; $graph_numberSuffix = '%'; $graph_title = 'Penyerapan Anggaran ' . $thangVal; $graph_width = 510; $graph_height = 250; $strXML_L = "<graph caption='" . $graph_caption . "' numberSuffix='" . $graph_numberSuffix . "' formatNumberScale='0' decimalPrecision='0'>"; // Store Name of months $monthList = $this->mlib->getMonth(); $getSerapanAnggaran = $this->msatker->getSerapanAnggaran($thangVal, $kdProgram, $kdUnit, $kdDept, $iskl); if ($getSerapanAnggaran) { $i = 0; foreach ($monthList as $month) { $arrData_P[$i][1] = $month; $i++; } $i = 0; foreach ($getSerapanAnggaran as $idx => $val) { $arrData_P[$i][2] = $val['value']; $i++; } // pre($arrData_P); foreach ($arrData_P as $arSubData) { if (isset($arSubData[2])) { $strXML_L .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />"; } } $strXML_L .= "</graph>"; $this->data['graph_L'] = renderChart($graph_swfFile, $graph_title, $strXML_L, "LINE", $graph_width, $graph_height); } else { $this->data['graph_L'] = "No data to show"; } // --------- PIE K/L --------- // $graph_swfFile_PieKL = base_url() . 'public/charts/Pie2D.swf'; $graph_caption_PieKL = 'Capaian Hasil ' . $this->data['deptName'] . ' Tahun Anggaran ' . $thangVal; $graph_numberPrefix_PieKL = ''; $graph_numberSuffix_PieKL = '%'; $graph_title_PKL = 'Penyerapan Anggaran'; $graph_width_PKL = 450; $graph_height_PKL = 250; $this->data['PKL'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, NULL, NULL); $this->data['notPKL'] = 100 - $this->data['PKL']; // Store Name of months $arrData_PKL[0][1] = "Anggaran terserap"; $arrData_PKL[1][1] = "Anggaran belum terserap"; //Store P data $arrData_PKL[0][2] = $this->data['PKL']; $arrData_PKL[1][2] = $this->data['notPKL']; $strXML_P = "<graph caption='" . $graph_caption_PieKL . "' numberSuffix='" . $graph_numberSuffix_PieKL . "' formatNumberScale='0' decimalPrecision='0'>"; foreach ($arrData_PKL as $arSubData) { $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />"; } $strXML_P .= "</graph>"; $this->data['graph_PKL'] = renderChart($graph_swfFile_PieKL, $graph_title_PKL, $strXML_P, "PIEPKL", $graph_width_PKL, $graph_height_PKL); // --------- PIE K/L --------- // // --------- PIE ESELON --------- // $graph_swfFile_PieEs = base_url() . 'public/charts/Pie2D.swf'; $graph_caption_PieEs = 'Capaian Hasil ' . $this->data['unitName'] . ' Tahun Anggaran ' . $thangVal; $graph_numberPrefix_PieEs = ''; $graph_numberSuffix_PieEs = '%'; $graph_title_PKL = 'Penyerapan Anggaran'; $graph_width_PKL = 450; $graph_height_PKL = 250; $this->data['PES'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, $kdUnit, NULL); $this->data['notPES'] = 100 - $this->data['PES']; // Store Name of months $arrData_PKL[0][1] = "Anggaran terserap"; $arrData_PKL[1][1] = "Anggaran belum terserap"; //Store P data $arrData_PKL[0][2] = $this->data['PES']; $arrData_PKL[1][2] = $this->data['notPES']; $strXML_P = "<graph caption='" . $graph_caption_PieEs . "' numberSuffix='" . $graph_numberSuffix_PieEs . "' formatNumberScale='0' decimalPrecision='0'>"; foreach ($arrData_PKL as $arSubData) { $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />"; } $strXML_P .= "</graph>"; $this->data['graph_PES'] = renderChart($graph_swfFile_PieEs, $graph_title_PKL, $strXML_P, "PIEES", $graph_width_PKL, $graph_height_PKL); // --------- PIE ESELON --------- // // --------- PIE PROGRAM --------- // $this->data['graph_PPRO'] = ""; if (isset($kdProgram)) { $graph_swfFile_PiePro = base_url() . 'public/charts/Pie2D.swf'; $graph_caption_PiePro = 'Capaian Hasil Dengan Kode Program ' . $post['kdprogram']; $graph_numberPrefix_PiePro = ''; $graph_numberSuffix_PiePro = '%'; $graph_title_PKL = 'Penyerapan Anggaran'; $graph_width_PKL = 450; $graph_height_PKL = 250; $this->data['PPRO'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, $kdUnit, $kdProgram); $this->data['notPPRO'] = 100 - $this->data['PPRO']; // Store Name of months $arrData_PKL[0][1] = "Anggaran terserap"; $arrData_PKL[1][1] = "Anggaran belum terserap"; //Store P data $arrData_PKL[0][2] = $this->data['PPRO']; $arrData_PKL[1][2] = $this->data['notPPRO']; $strXML_P = "<graph caption='" . $graph_caption_PiePro . "' numberSuffix='" . $graph_numberSuffix_PiePro . "' formatNumberScale='0' decimalPrecision='0'>"; foreach ($arrData_PKL as $arSubData) { $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />"; } $strXML_P .= "</graph>"; $this->data['graph_PPRO'] = renderChart($graph_swfFile_PiePro, $graph_title_PKL, $strXML_P, "PIEPRO", $graph_width_PKL, $graph_height_PKL); } // --------- PIE PROGRAM --------- // $this->data['template'] = 'laporan/laporan_ch_satker'; $this->load->view('index', $this->data); }
//We first request the data from the form (Default.php) $intSoups = $_POST['Soups']; $intSalads = $_POST['Salads']; $intSandwiches = $_POST['Sandwiches']; $intBeverages = $_POST['Beverages']; $intDesserts = $_POST['Desserts']; //In this example, we're directly showing this data back on chart. //In your apps, you can do the required processing and then show the //relevant data only. //Now that we've the data in variables, we need to convert this into XML. //The simplest method to convert data into XML is using string concatenation. //Initialize <graph> element $strXML = "<graph caption='Sales by Product Category' subCaption='For this week' showPercentValues='1' showPercentageInLabel='1' pieSliceDepth='25' showBorder='1' decimalPrecision='0' showNames='1'>"; //Add all data $strXML .= "<set name='Soups' value='" . $intSoups . "' />"; $strXML .= "<set name='Salads' value='" . $intSalads . "' />"; $strXML .= "<set name='Sandwitches' value='" . $intSandwiches . "' />"; $strXML .= "<set name='Beverages' value='" . $intBeverages . "' />"; $strXML .= "<set name='Desserts' value='" . $intDesserts . "' />"; //Close <grapht> element $strXML .= "</graph>"; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("../../FusionCharts/FCF_Pie3D.swf", "", $strXML, "Sales", 600, 350, false, false); ?> <a href='javascript:history.go(-1);'>Enter data again</a> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
<CENTER> <h2><a href="http://www.fusioncharts.com" target="_blank">FusionCharts Free</a> Examples</h2> <h4>Multiple Charts on the same page. Each chart has a unique ID.</h4> <?php //This page demonstrates how you can show multiple charts on the same page. //For this example, all the charts use the pre-built Data.xml (contained in /Data/ folder) //However, you can very easily change the data source for any chart. //IMPORTANT NOTE: Each chart necessarily needs to have a unique ID on the page. //If you do not provide a unique Id, only the last chart might be visible. //Here, we've used the ID chart1, chart2 and chart3 for the 3 charts on page. //Create the chart - Column 3D Chart with data from Data/Data.xml echo renderChart("../../FusionCharts/FCF_Column3D.swf", "Data/Data.xml", "", "chart1", 600, 300); ?> <BR><BR> <?php //Now, create a Column 2D Chart echo renderChart("../../FusionCharts/FCF_Column2D.swf", "Data/Data.xml", "", "chart2", 600, 300); ?> <BR><BR> <?php //Now, create a Line 2D Chart echo renderChart("../../FusionCharts/FCF_Line.swf", "Data/Data.xml", "", "chart3", 600, 300); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the charts above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <BODY> <CENTER> <h2>FusionCharts Examples</h2> <h4>Example using multilingual text from database</h4> <?php //This page demonstrates the ease of generating charts using FusionCharts. //For this chart, we've retrieved multilingual text from database //through a XML relayer script file Data/getXMLFromDatabase.php //The file Data/getXMLFromDatabase.php is already ANSI encoded without BOM //We add the BOM in the file using script //Create the chart - Column 2D Chart echo renderChart("../../FusionCharts/Column2D.swf", "Data/getXMLFromDatabase_writeBOM.php", "", "myFirst", 500, 400, false, false); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
function renderChartFromExtXML($dataXML) { print renderChart($this->SWFFile, "", $dataXML, $this->chartID, $this->width, $this->height, $this->debugMode, $this->registerWithJS, $this->bgColor, $this->scaleMode, $this->lang); }
//$strXML will be used to store the entire XML document generated //Generate the graph element $strXML = "<graph caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' showNames='1' formatNumberScale='0' numberSuffix=' Units' decimalPrecision='0'>"; // Fetch all factory records $strQuery = "select * from Factory_Master"; $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(Quantity) as TotOutput from Factory_Output where FactoryId=" . $ors['FactoryId']; $result2 = mysql_query($strQuery) or die(mysql_error()); $ors2 = mysql_fetch_array($result2); //Generate <set name='..' value='..' /> $strXML .= "<set name='" . $ors['FactoryName'] . "' value='" . $ors2['TotOutput'] . "' />"; //free the resultset mysql_free_result($result2); } } mysql_close($link); //Finally, close <graph> element $strXML .= "</graph>"; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("../../FusionCharts/FCF_Pie3D.swf", "", $strXML, "FactorySum", 650, 450); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
if ($result) { $strXML = "<categories>"; while ($ors = oci_fetch_array($result)) { $strXML .= "<category label='" . $ors[$labelField] . "'/>"; } $strXML .= "</categories>"; } return $strXML; } /*********************************************************************************************** * Function to build XML for datesets that would contain chart data * @param $result Database resource. The data should come ordered by a control break * field which would require to identify datasets and set its value to * dataset's series name * @param $valueField Field name as String that contains value for chart dataplots * @param $controlBreak Field name as String that contains value for chart dataplots * * @return Dataset XML node */ function buildDatasets($result, $valueField, $controlBreak) { $strXML = ""; if ($result) { $controlBreakValue = ""; while ($ors = oci_fetch_array($result)) { if ($controlBreakValue != $ors[$controlBreak]) { $controlBreakValue = $ors[$controlBreak]; $strXML .= ($strXML == "" ? "" : "</dataset>") . ("<dataset seriesName='" . $controlBreakValue . "'>"); } $strXML .= "<set value='" . $ors[$valueField] . "'/>"; }
//Initialize <graph> element $strXML = "<graph caption='Product A - Sales Details' PYAxisName='Revenue' SYAxisName='Quantity (in Units)' numberPrefix='\$' formatNumberScale='0' showValues='0' decimalPrecision='0' anchorSides='10' anchorRadius='3' anchorBorderColor='FF8000'>"; //Initialize <categories> element - necessary to generate a multi-series chart $strCategories = "<categories>"; //Initiate <dataset> elements $strDataRev = "<dataset seriesName='Revenue' color='AFD8F8' >"; $strDataQty = "<dataset seriesName='Quantity' parentYAxis='S' color='FF8000'>"; //Iterate through the data foreach ($arrData as $arSubData) { //Append <category name='...' /> to strCategories $strCategories .= "<category name='" . $arSubData[1] . "' />"; //Add <set value='...' /> to both the datasets $strDataRev .= "<set value='" . $arSubData[2] . "' />"; $strDataQty .= "<set value='" . $arSubData[3] . "' />"; } //Close <categories> element $strCategories .= "</categories>"; //Close <dataset> elements $strDataRev .= "</dataset>"; $strDataQty .= "</dataset>"; //Assemble the entire XML now $strXML .= $strCategories . $strDataRev . $strDataQty . "</graph>"; //Create the chart - MS Column 3D Line Combination Chart with data contained in strXML echo renderChart("../../FusionCharts/FCF_MSColumn3DLineDY.swf", "", $strXML, "productSales", 600, 300); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
function homepage($title) { if (!check_login()) { header('location:login.php'); } else { echo "<!DOCTYPE html>\n<html>\n\t<SCRIPT LANGUAGE=\"Javascript\" SRC=\"assets/charts/FusionCharts.js\"></SCRIPT>"; display_headers($title); echo "\n<body>"; menu(); echo <<<a \t<div class='container'> \t\t<div id='error'></div> \t\t<div class='row'> a; echo '<div class="span9"><div class="well well-large" style="background:#FFF;">'; /* Pattern Matching */ $reg1 = "/^N[0-9]{6}\$/"; $reg2 = "/^p|(sub)\$/"; $qs = $_SERVER["QUERY_STRING"]; $va = explode("/", $qs); $qs1 = $va[0]; $qs2 = $va[1]; if (preg_match($reg1, $qs1) and preg_match($reg2, $qs2)) { /* Fetching Details */ include 'config/db.php'; include 'config/settings.php'; $dbname = $branchyear . '_Users'; $table = $branchyear . '_Students'; //if(!mysql_select_db($dbname)) die(mysql_error()); $userid = $_SERVER["QUERY_STRING"]; $resultant = explode("/", $userid); $id = $resultant[0]; $mode = $resultant[1]; $q = "select Name,Gender,Position, Branch, Class ,RNo from {$table} where Id = '{$id}'"; $res = mysql_query($q) or die(mysql_error()); if (mysql_num_rows($res) == 0) { echo "<script>document.location.href='404.php';</script>"; } $row = mysql_fetch_array($res); $username = ucwords(strtolower($row['Name'])); $gender = $row['Gender']; $RNo = $row["RNo"]; $type = $row['Position']; $class = $row['Class']; $branch = $row['Branch']; $colors = array('F6BD0F', '8BBA00', 'FF8E46', '8E468E', '588526', '008ED6', '9D080D', 'D64646', 'B3AA00', 'A186BE', 'AFD8F8'); shuffle($colors); /* Deatils Fetched */ echo <<<a \t\t<div id="step1" class="span6"> \t\t<a ><h5>Student Attendance Report for {$id} </h5></a> \t\t<h6>     -   Lising Attendance details submitted from CR @ {$branch} {$class}</h6><br> \t\t</div> \t\t<table class="table table-hover table-bordered"> \t\t<tbody> \t\t<tr><th>Name </th> <td>{$username}</td> <th>Gender </th> <td>{$gender}</td> </tr> \t\t<tr><th>RNo </th> <td>{$RNo}</td> <th>Class </th> <td>{$branch} {$class} </td></tr> \t\t</tbody> \t\t</table> \t<div id="step1" class="span4"> \t\t<h5>Chart Based Representaiton </h5> \t</div> \t<div id="side1" class="span4" > \t\t<h6 class='text-right'><a href='?{$id}/sub' ><i class='icon-book'></i> Subjects</a>   <a href='?{$id}/p'><i class='icon-qrcode'></i> Periods</a></h6> \t</div> a; if (strtolower($mode) == "p") { //mysql_select_db($branchyear."_Dates") or die(mysql_error()); $query = mysql_query("Select Date from " . $branch . $class . "_Dates where P1_Con = 'ok' or P2_Con = 'ok' or P3_Con = 'ok' or P4_Con = 'ok' ;") or die(mysql_error()); $nofd = mysql_num_rows($query); if ($nofd != 0) { $p = array("P1_A" => 0, "P1_P" => 0, "P2_A" => 0, "P2_P" => 0, "P3_A" => 0, "P3_P" => 0, "P4_A" => 0, "P4_P" => 0); $stats = array("Total" => 0, "Presents" => 0, "Absents" => 0); $strXML = "<graph caption='Period Wise Attendance Report' formatNumberScale='1' rotateValues='1' decimalPrecision='1' numberSuffix='%' xAxisName='Periods' yAxisName='Performance'>"; $datasetp = ''; while ($dates = mysql_fetch_array($query)) { //mysql_select_db($branchyear."_Attendance") or die(mysql_error()); $q = mysql_query("select `" . $dates[0] . "` from " . $branch . $class . "_Attendance where RNo='" . $RNo . "';"); while ($res = mysql_fetch_array($q)) { $values = explode(",", $res[0]); for ($i = 0; $i < count($values) - 1; $i++) { if (substr($values[$i], -1) == "P") { $stats["Presents"] += 1; $stats["Total"] += 1; } if (substr($values[$i], -1) == "A") { $stats["Absents"] += 1; $stats["Total"] += 1; } $p[$values[$i]] += 1; } } } $tr = ''; for ($i = 1; $i <= 4; $i++) { $st = round($p["P" . $i . "_P"] / $nofd, 1) * 100 <= 50 ? "error" : "success"; $tr .= '<tr> <td style="text-align:center;">' . $i . '</td> <td style="text-align:center;"> P' . $i . ' </td> <td style="text-align:center;"><b> ' . $nofd . '</b> </td> <td style="text-align:center;" class="text-success"><b> ' . $p["P" . $i . "_P"] . ' </b></td> <td style="text-align:center;" class="text-success"><b> ' . round($p["P" . $i . "_P"] / $nofd, 1) . ' </b></td> <td style="text-align:center;" class="text-error"><b> ' . $p["P" . $i . "_A"] . ' </b></td> <td style="text-align:center;" class="text-error"><b> ' . round($p["P" . $i . "_A"] / $nofd, 1) . ' </b></td> <td style="text-align:center;" class="text-' . $st . '"><b> ' . round($p["P" . $i . "_P"] / $nofd, 1) * 100 . ' % </b></td> </tr>'; $datasetp .= "<set name='P" . $i . "' value='" . round($p["P" . $i . "_P"] / $nofd, 1) * 100 . "' color='" . $colors[$i] . "'/>"; } $strXML .= $datasetp . "</graph>"; echo renderChart("assets/charts/FCF_Column3D.swf", "", $strXML, "FactorySum", 650, 380); echo <<<table_head \t\t<h5> Period Wise Attendance Representation </h5><br> \t\t<table class="table table-hover table-bordered " style="padding:0px;"> \t\t\t<thead> \t\t\t\t<tr> \t\t\t\t<th style="text-align:center;" valign="top"> SNo </th> <th style="text-align:center;" valign="top"> Period </th> <th style="text-align:center;" > Days </th> <th style="text-align:center;" > Presents </th> <th style="text-align:center;" > P/Day </th> <th style="text-align:center;" > Absents </th> <th style="text-align:center;" > A/Day </th><th style="text-align:center;" > Performance </th> \t\t\t\t</tr> \t\t\t</thead> \t\t\t<tbody> table_head; echo $tr; echo <<<tableend \t\t\t</tbody> \t\t</table> \t\t<br><div class='alert alert-info'><a class='close' data-dismiss='alert'>×</a><strong>CNYS </strong>: Classes Not Yet Started </div> \t<br> tableend; } else { echo "<br><br><h6 class='text-error text-center'> No Submissions Found<br></h6>"; } } /* End of Period Wise Attendance*/ /* SUbjects Wise Attendance */ if (strtolower($mode) == "sub") { //mysql_select_db($branchyear."_Subjects") or die(mysql_error()); $query = mysql_query("Select * from " . $branch . $class . "_Subjects where RNo='{$RNo}';") or die(mysql_error()); $subjectwise = mysql_fetch_array($query) or die(mysql_error()); $tr = ''; $strXML = "<graph caption='Subject Wise Attendance Report' formatNumberScale='1' rotateValues='1' decimalPrecision='1' numberSuffix='%' xAxisName='Subjects' yAxisName='Performance'>"; $datasetp = ''; $nc_cls = 0; for ($i = 0; $i < count($allowed_subjects); $i++) { $tnoc = $subjectwise[$allowed_subjects[$i] . "_P"] + $subjectwise[$allowed_subjects[$i] . "_A"]; if ($tnoc == 0) { $nc_cls++; $performance = "N/A "; $st = "error"; $remarks = "CNYS"; } else { $performance = $subjectwise[$allowed_subjects[$i] . "_P"] / $tnoc * 100; $performance = round($performance, 1) . " %"; $st = $performance <= 50 ? "error" : "success"; if (round($performance, 1) >= 95) { $remarks = "Excellent"; } if (round($performance, 1) >= 90 && round($performance, 1) < 95) { $remarks = "Very Good"; } if (round($performance, 1) >= 80 && round($performance, 1) < 90) { $remarks = "Good"; } if (round($performance, 1) >= 70 && round($performance, 1) < 80) { $remarks = "Normal"; } if (round($performance, 1) >= 60 && round($performance, 1) < 70) { $remarks = "Average"; } if (round($performance, 1) >= 50 && round($performance, 1) < 60) { $remarks = "Bad"; } if (round($performance, 1) < 50) { $remarks = "Go Out"; } } $tr .= '<tr> <td style="text-align:center;">' . ($i + 1) . '</td> <td style="text-align:center;"> <b>' . $allowed_subjects[$i] . '</b> </td> <td style="text-align:center;"> <b>' . $tnoc . '</b> </td> <td style="text-align:center;" class="text-success"><b> ' . $subjectwise[$allowed_subjects[$i] . "_P"] . '</b> </td> <td style="text-align:center;" class="text-error"><b> ' . $subjectwise[$allowed_subjects[$i] . "_A"] . ' </b></td> <td style="text-align:center;" class="text-' . $st . '"><b>' . $performance . '</b></td> <td style="text-align:center;" class="text-' . $st . '"><b>' . $remarks . '</b></td> </tr>'; $datasetp .= "<set name='" . $allowed_subjects[$i] . "' value='" . round($performance, 1) . "' color='" . $colors[$i] . "'/>"; } $strXML .= $datasetp . "</graph>"; if ($nc_cls != count($allowed_subjects)) { echo renderChart("assets/charts/FCF_Column3D.swf", "", $strXML, "FactorySum", 650, 380); echo <<<table_head \t\t<h5> Subject Wise Attendance Representation </h5><br> \t\t<table class="table table-hover table-bordered " style="padding:0px;"> \t\t\t<thead> \t\t\t\t<tr> \t\t\t\t<th style="text-align:center;" rowspan="2" valign="top"> SNo </th> <th style="text-align:center;" valign="top"> Subject </th> <th style="text-align:center;" > Classes </th> <th style="text-align:center;" > Presents </th> <th style="text-align:center;" > Absents </th> <th style="text-align:center;" > Performance </th> <th style="text-align:center;" > Remarks </th> \t\t\t\t</tr> \t\t\t</thead> \t\t\t<tbody> table_head; echo $tr; echo <<<tableend \t\t\t</tbody> \t\t</table> \t\t<br><div class='alert alert-info'><a class='close' data-dismiss='alert'>×</a><strong>CNYS </strong>: Classes Not Yet Started </div> \t<br> tableend; } else { echo "<br><br><h6 class='text-error text-center'> No Submissions Found<br></h6>"; } } /* Subject WIse */ } else { echo "<script type='text/javascript'>show_error('Error: Invalid Syntax given..');</script>"; } echo <<<b \t</div> \t</div> \t<div class='span3'> b; go_home(); sidepanel(); echo "</div></div></div>"; display_footer(); echo "\n</body>\n</html>"; } }
$data8 .= "<set value='" . $arSubData[10] . "' />"; } } $kategori .= "</categories>"; $data .= "</dataset>"; $data1 .= "</dataset>"; $data2 .= "</dataset>"; $data3 .= "</dataset>"; $data4 .= "</dataset>"; $data5 .= "</dataset>"; $data6 .= "</dataset>"; $data7 .= "</dataset>"; $data8 .= "</dataset>"; $strXML .= $kategori . $data . $data1 . $data2 . $data3 . $data4 . $data5 . $data6 . $data7 . $data8; $strXML .= "</graph>"; echo renderChart("FusionCharts/FCF_MSBar2D.swf", "", $strXML, "productSales", 1225, 600); ?> <br></br> <br></br><link rel="stylesheet" href="tabel.css" /> <body onLoad="document.postform.elements['provinsi'].focus();"> <?php //untuk koneksi database //untuk menantukan tahun awal dan tahun akhir data di database $min_tahun = mysql_fetch_array(mysql_query("select min(tahun) as min_tahun from view_jumlah")); $max_tahun = mysql_fetch_array(mysql_query("select max(tahun) as max_tahun from view_jumlah")); ?> <form action="?page=grafik" method="post" name="postform">
mysql_connect("localhost", "root", ""); mysql_select_db("idsr"); function dateDiff($start, $end) { $start_ts = strtotime($start); $end_ts = strtotime($end); $diff = $end_ts - $start_ts; return round($diff / 86400); } $dateArray = array(); //$districts = array(); $counter = 0; $dateSql = "select reportingtime, deadline, district from dashboarddemo"; $dateQuery = mysql_query($dateSql) or die(mysql_error()); while ($dateResults = mysql_fetch_assoc($dateQuery)) { $dateArray[$counter][1] = dateDiff($dateResults['reportingtime'], $dateResults['deadline']); $dateArray[$counter][2] = $dateResults['district']; $counter++; } echo "<p align=center><b> Timeliness </b></p>"; $strXML = "<chart formatNumberScale='0'>"; foreach ($dateArray as $dates) { $strXML .= "<set label='" . $dates[2] . "' value='" . $dates[1] . "' />"; } $strXML .= "<trendlines><line startValue='0' isTrendZone='0' displayValue='Deadline 30-06-2011' color='ff0000'/></trendlines>"; $strXML .= "</chart>"; echo renderChart("FusionCharts/Bar2D.swf", "", $strXML, "", 800, 500, false, false); ?> </body> </html>
<?php include "Scripts/FusionCharts/FusionCharts.php"; $array_size = count($detail_e1); $strXML_e1 = "<chart palette='2' bgColor='#FFFFFF' showBorder='0' caption='Expiries per commodity'subcaption='{$name}' xAxisName='Month' yAxisName='Units' showValues='0' decimals='0' formatNumberScale='0' useRoundEdges='1'>"; if ($array_size > 0) { for ($i = 0; $i < $array_size; $i++) { $month = date("M", strtotime($detail_e1[$i]['expiry_date'])); $total = $detail_e1[$i]['total']; $strXML_e1 .= "<set label='{$month}' value='{$total}' />"; } } else { $strXML_e1 .= "<set label='' value='' />"; } $strXML_e1 .= "</chart>"; echo renderChart("" . base_url() . "Scripts/FusionCharts/Charts/Column2D.swf", "", $strXML_e1, "e1", 500, 300, false, true);
<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <BODY> <CENTER> <h2><a href="http://www.fusioncharts.com" target="_blank">FusionCharts V3</a> Examples</h2> <h4>Simple Column 3D Chart using dataURL method</h4> <?php //This page demonstrates the ease of generating charts using FusionCharts. //For this chart, we've used a Data.php which uses FusionCharts PHP Class (contained in /Data/ folder) //Data.php contains UTF-8 encoded multilingual text //We will use FusionCharts PHP function - renderChart() to render the chart usin the XML //For a head-start, we've kept this example very simple. //Create the chart - Column 2D Chart with data from Data/Data.xml echo renderChart("../../FusionCharts/Column2D.swf", "Data/Data.php", "", "myFirst", 500, 400, false, false); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
<?php //Separator line echo drawSepLine(); ?> <table width='800' align='center'> <tr> <td width='400' align='center' style='BORDER-RIGHT:#EEEEEE 1px solid;'> <?php //Combi 2D Chart with changed "No data to display" message //We initialize the chart with <chart></chart> echo renderChart("FusionCharts/MSCombiDY2D.swf?ChartNoDataText=Please select a country above.", "", "<chart></chart>", "CityDetails", 420, 250, false, true); ?> </td> <td width='400' align='center'> <?php //Combi 2D Chart with changed "No data to display" message //We initialize the chart with <chart></chart> echo renderChart("FusionCharts/MSCombiDY2D.swf?ChartNoDataText=Please select a country above.", "", "<chart></chart>", "CustomerDetails", 420, 250, false, true); ?> </td> </tr> </table> <?php //Close the main table echo render_pageTableClose(); ?> </BODY> </HTML>
// $strDataProdB - Stores XML for previous year's sales //Initialize <chart> element $strXML = "<chart caption='Sales' numberPrefix='\$' formatNumberScale='0'>"; //Initialize <categories> element - necessary to generate a stacked chart $strCategories = "<categories>"; //Initiate <dataset> elements $strDataProdA = "<dataset seriesName='Product A'>"; $strDataProdB = "<dataset seriesName='Product B'>"; //Iterate through the data foreach ($arrData as $arSubData) { //Append <category name='...' /> to strCategories $strCategories .= "<category name='" . $arSubData[1] . "' />"; //Add <set value='...' /> to both the datasets $strDataProdA .= "<set value='" . $arSubData[2] . "' />"; $strDataProdB .= "<set value='" . $arSubData[3] . "' />"; } //Close <categories> element $strCategories .= "</categories>"; //Close <dataset> elements $strDataProdA .= "</dataset>"; $strDataProdB .= "</dataset>"; //Assemble the entire XML now $strXML = $strXML . $strCategories . $strDataProdA . $strDataProdB . "</chart>"; //Create the chart - Stacked Column 3D Chart with data contained in strXML echo renderChart("../../FusionCharts/StackedColumn3D.swf", "", $strXML, "productSales", 500, 300, false, false); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> </CENTER> </BODY> </HTML>
$strXML = "<graph caption='Sales' numberPrefix='\$' formatNumberScale='0' decimalPrecision='0'>"; //Initialize <categories> element - necessary to generate a stacked chart $strCategories = "<categories>"; //Initiate <dataset> elements $strDataProdA = "<dataset seriesName='Product A' color='AFD8F8'>"; $strDataProdB = "<dataset seriesName='Product B' color='F6BD0F'>"; //Iterate through the data foreach ($arrData as $arSubData) { //Append <category name='...' /> to strCategories $strCategories .= "<category name='" . $arSubData[1] . "' />"; //Add <set value='...' /> to both the datasets $strDataProdA .= "<set value='" . $arSubData[2] . "' />"; $strDataProdB .= "<set value='" . $arSubData[3] . "' />"; } //Close <categories> element $strCategories .= "</categories>"; //Close <dataset> elements $strDataProdA .= "</dataset>"; $strDataProdB .= "</dataset>"; //Assemble the entire XML now $strXML = $strXML . $strCategories . $strDataProdA . $strDataProdB . "</graph>"; //Create the chart - Stacked Column 3D Chart with data contained in strXML echo renderChart("../../FusionCharts/FCF_StackedColumn3D.swf", "", $strXML, "productSales", 600, 300); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <BODY> <CENTER> <h2><a href="http://www.fusioncharts.com" target="_blank">FusionCharts Free</a> UTF8 Français (French) Example</h2> <h4>Basic example using pre-built DataFrench.php</h4> <?php /* In this example, we show how to use UTF characters in charts created with FusionCharts Here, the XML data for the chart is present in Data/FrenchData.xml. The xml file should be created and saved with an editor which places the UTF8 BOM. The first line of the xml should contain the xml declaration like this: <?xml version="1.0" encoding="UTF-8" ?> */ //Create the chart - Column 3D Chart with data from Data/FrenchData.xml echo renderChart("../../FusionCharts/FCF_Column3D.swf", "Data/DataFrench.php", "", "FrenchChart", 600, 300); ?> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> <H5 ><a href='../default.htm'>« Back to list of examples</a></h5> </CENTER> </BODY> </HTML>
<div class="logo"><a class="imagelink" href="http://www.fusioncharts.com/" target="_blank"><img src="../assets/ui/images/fusionchartsv3.2-logo.png" width="131" height="75" alt="FusionCharts XT logo" /></a></div> <h1 class="brand-name">FusionCharts XT</h1> <h1 class="logo-text">FusionCharts Examples</h1> </div> <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Export example - Export chart and save the exported file to a server-side folder</h2> <div class="gen-chart-render"> <CENTER> <?php //Create the chart - Column 3D Chart with data from Data/Data.xml echo renderChart("../../FusionCharts/Column3D.swf", "Data/SaveData.xml", "", "myFirst", 600, 300, false, true); ?> <div id="linkToExportedFile" style="margin-top:10px; padding:5px; width:600px; background:#efefef; border : 1px dashed #cdcdcd; color: 666666;">Exported status.</div> <br/> <input value="Export to JPG" type="button" onClick="JavaScript:exportChart('JPG')" /> <input value="Export to PNG" type="button" onClick="JavaScript:exportChart('PNG')" /> <input value="Export to PDF" type="button" onClick="JavaScript:exportChart('PDF')" /> </CENTER> </div> <div class="clear"></div> <p> </p> <p class="small">Right click on the chart to accee various export options or click any of the buttons below</p>
$link = connectToDB(); //Now, we get the data for that factory $strQuery = "select * from Factory_Output where FactoryId=" . $FactoryId; $result = mysql_query($strQuery) or die(mysql_error()); //Iterate through each factory if ($result) { while ($ors = mysql_fetch_array($result)) { //Here, we convert date into a more readable form for set label. $strXML .= "<set label='" . datePart("d", $ors['DatePro']) . "/" . datePart("m", $ors['DatePro']) . "' value='" . $ors['Quantity'] . "'/>"; } } mysql_close($link); //Close <chart> element $strXML .= "</chart>"; //Create the chart - Column 2D Chart with data from strXML echo renderChart("../../FusionCharts/Column2D.swf", "", $strXML, "FactoryDetailed", 600, 300, false, false); ?> <BR/> <a class="qua qua-button" style="margin-left: 360px" href="Default.php?animate=0"><span>Back to Summary</span></a> </div> <div class="clear"></div> <p> </p> <p class="small"> <!--<p class="small">This dashboard was created using FusionCharts XT, FusionWidgets v3 and FusionMaps v3 You are free to reproduce and distribute this dashboard in its original form, without changing any content, whatsoever. <br /> © All Rights Reserved</p> <p> </p>--> </p> <div class="underline-dull"></div> </div>
<?php //We first request the data from the form (Default.php) $intSoups = $_POST['Soups']; $intSalads = $_POST['Salads']; $intSandwiches = $_POST['Sandwiches']; $intBeverages = $_POST['Beverages']; $intDesserts = $_POST['Desserts']; //In this example, we're directly showing this data back on chart. //In your apps, you can do the required processing and then show the //relevant data only. //Now that we've the data in variables, we need to convert this into XML. //The simplest method to convert data into XML is using string concatenation. //Initialize <chart> element $strXML = "<chart caption='Sales by Product Category' subCaption='For this week' showPercentValues='1' pieSliceDepth='30' showBorder='1'>"; //Add all data $strXML .= "<set label='Soups' value='" . $intSoups . "' />"; $strXML .= "<set label='Salads' value='" . $intSalads . "' />"; $strXML .= "<set label='Sandwiches' value='" . $intSandwiches . "' />"; $strXML .= "<set label='Beverages' value='" . $intBeverages . "' />"; $strXML .= "<set label='Desserts' value='" . $intDesserts . "' />"; //Close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("../../FusionCharts/Pie3D.swf", "", $strXML, "Sales", 500, 300, false, false); ?> <a href='javascript:history.go(-1);'>Enter data again</a> <BR><BR> <a href='../NoChart.html' target="_blank">Unable to see the chart above?</a> </CENTER> </BODY> </HTML>
//For this example, all the charts use the pre-built Data.xml (contained in /Data/ folder) //However, you can very easily change the data source for any chart. // Create a Column 2D Chart with data from Data/Data.xml echo renderChart("../../FusionCharts/Column2D.swf", "Data/Data.xml", "", "chart1", 600, 300, false, true); ?> <BR><BR> <?php FC_SetRenderer("javascript"); // Now, create a Line Chart echo renderChart("../../FusionCharts/Line.swf", "Data/Data.xml", "", "chart2", 600, 300, false, true); ?> <BR><BR> <?php FC_SetRenderer("javascript"); // Now, create a Area 2D Chart echo renderChart("../../FusionCharts/Area2D.swf", "Data/Data.xml", "", "chart3", 600, 300, false, true); ?> </center> </div> <div class="clear"></div> <p> </p> <p class="small"> <!--<p class="small">This dashboard was created using FusionCharts XT, FusionWidgets v3 and FusionMaps v3 You are free to reproduce and distribute this dashboard in its original form, without changing any content, whatsoever. <br /> © All Rights Reserved</p> <p> </p>--> </p> <div class="underline-dull"></div> </div> </div> <div id="footer">
$districtres = mysql_fetch_assoc($districtsquery); $testBuffer = mysql_query($testSql) or die(mysql_error()); $erickofala = 0; while ($testResult = mysql_fetch_array($testBuffer)) { $namesnids[$erickofala][1] = $testResult['Names']; $namesnids[$erickofala][2] = $testResult['Submitters']; $erickofala++; } echo "<p align=center><b> Natioanl Reporting Statistics For Epiweek {$_GET['epiweek']}</b></p>"; $strXML = "<chart formatNumberScale='0' bgColor='ffffff' showBorder='0'>"; foreach ($namesnids as $names) { $strXML .= "<set label='" . $names[1] . "' value='" . $names[2] . "' />"; $strXML .= "<set label='" . $names[1] . "' value='" . ($districtres['expected'] - $names[2]) . "' />"; } $strXML .= "</chart>"; echo renderChart("FusionCharts/Pie2D.swf", "", $strXML, "chart3", 500, 300, false, false); } //end else ?> </td> <td valign="top" class="text" align="center"><div id="chartdivx" align="center"> </div> <script type="text/javascript"> var chart = new FusionCharts("FusionCharts/MSLine.swf", "chartdivx", "500", "300", "0", "0"); chart.setDataURL("TrendTimeliness.php"); chart.render("chartdivx"); </script></td> </tr> </table>
//Iterate through each factory if ($result) { while ($ors = mysql_fetch_array($result)) { //Generate <set label='..' value='..' link='..' /> //Note that we're setting link as newchart-xmlurl-url //This link denotes that linked chart would open //The source data for each each is defined in the URL which will get data dynamically from the database as per the fctory id $strXML .= "<set label='" . $ors['FactoryName'] . "' value='" . $ors['TotOutput'] . "' link='newchart-xmlurl-FactoryData.php?factoryId=" . $ors['FactoryId'] . "'/>"; //free the resultset } } mysql_close($link); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML echo renderChart("../../FusionCharts/Pie3D.swf", "", $strXML, "FactorySum", 500, 250, false, true); ?> <br> <center> <!-- linked chart container --> <div id="linked-chart" style="width:600px; height:250px; border:1px solid #999;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="250" > <tr> <td align="center" valign="middle">Click on a pie slice above to see the linked chart appear here</td> </tr> </table> </div> </center> <script type="text/javascript">