<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example1"); $chart->plot($data); $chart->stroke(); ?>
$Qstats = $osC_Database->query('select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from :table_banners_history where banners_id = :banners_id and year(banners_history_date) = :year group by banner_month'); $Qstats->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY); $Qstats->bindInt(':banners_id', $_REQUEST['banners_id']); $Qstats->bindInt(':year', $year); $Qstats->execute(); while ($Qstats->next()) { $stats[$Qstats->valueInt('banner_month') - 1] = array(strftime('%b', mktime(0, 0, 0, $Qstats->valueInt('banner_month'), 1, $year)), $Qstats->valueInt('value') > 0 ? $Qstats->valueInt('value') : '0', $Qstats->valueInt('dvalue') > 0 ? $Qstats->valueInt('dvalue') : '0'); $views[$Qstats->valueInt('banner_month') - 1] = $Qstats->valueInt('value'); $clicks[$Qstats->valueInt('banner_month') - 1] = $Qstats->valueInt('dvalue'); } $vLabels = array(); for ($i = 1; $i < 13; $i++) { $vLabels[] = strftime('%b', mktime(0, 0, 0, $i, 1, $year)); if (!isset($views[$i - 1])) { $views[$i - 1] = 0; } if (!isset($clicks[$i - 1])) { $clicks[$i - 1] = 0; } } $ochart = new chart(600, 350, 5, '#eeeeee'); $ochart->setTitle(sprintf($osC_Language->get('subsection_heading_statistics_monthly'), $title, $year), '#000000', 2); $ochart->setPlotArea(SOLID, '#444444', '#dddddd'); $ochart->setFormat(0, ',', '.'); $ochart->setXAxis('#000000', SOLID, 1, $year); $ochart->setYAxis('#000000', SOLID, 2, ''); $ochart->setLabels($vLabels, '#000000', 1, VERTICAL); $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); $ochart->addSeries($views, 'area', 'Series1', SOLID, '#000000', '#0000ff'); $ochart->addSeries($clicks, 'area', 'Series1', SOLID, '#000000', '#ff0000'); $ochart->plot('images/graphs/banner_monthly-' . $_REQUEST['banners_id'] . '.png');
/** @package admin::graphs @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: banner_yearly.php v1.0 2013-08-08 datazen $ */ function lc_banner_yearly($_id) { global $lC_Database, $lC_Language, $lC_Vqmod; require $lC_Vqmod->modCheck('external/panachart/panachart.php'); $lC_ObjectInfo = new lC_ObjectInfo(lC_Banner_manager_Admin::getData($_id)); $image_extension = lc_dynamic_image_extension(); $views = array(); $clicks = array(); $vLabels = array(); $stats = array(); $Qstats = $lC_Database->query('select year(banners_history_date) as year, sum(banners_shown) as value, sum(banners_clicked) as dvalue from :table_banners_history where banners_id = :banners_id group by year'); $Qstats->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY); $Qstats->bindInt(':banners_id', $_id); $Qstats->execute(); while ($Qstats->next()) { $stats[] = array($Qstats->valueInt('year'), $Qstats->valueInt('value') > 0 ? $Qstats->valueInt('value') : '0', $Qstats->valueInt('dvalue') > 0 ? $Qstats->valueInt('dvalue') : '0'); $views[] = $Qstats->valueInt('value'); $clicks[] = $Qstats->valueInt('dvalue'); $vLabels[] = $Qstats->valueInt('year'); } $ochart = new chart(600, 350, 5, '#eeeeee'); $ochart->setTitle(sprintf($lC_Language->get('subsection_heading_statistics_yearly'), $lC_ObjectInfo->get('banners_title')), '#000000', 2); $ochart->setPlotArea(SOLID, '#444444', '#dddddd'); $ochart->setFormat(0, ',', '.'); $ochart->setXAxis('#000000', SOLID, 1, ''); $ochart->setYAxis('#000000', SOLID, 2, ''); $ochart->setLabels($vLabels, '#000000', 1, VERTICAL); $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); $ochart->addSeries($views, 'area', 'Series1', SOLID, '#000000', '#0000ff'); $ochart->addSeries($clicks, 'area', 'Series1', SOLID, '#000000', '#ff0000'); $ochart->plot('images/graphs/banner_yearly-' . $_id . '.' . $image_extension); return $stats; }
/** @package admin::graphs @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: banner_daily.php v1.0 2013-08-08 datazen $ */ function lc_banner_daily($_id, $_month, $_year) { global $lC_Database, $lC_Language, $lC_Vqmod; require $lC_Vqmod->modCheck('external/panachart/panachart.php'); $lC_ObjectInfo = new lC_ObjectInfo(lC_Banner_manager_Admin::getData($_id)); $image_extension = lc_dynamic_image_extension(); $views = array(); $clicks = array(); $vLabels = array(); $days = @date('t', @mktime(0, 0, 0, $_month)) + 1; $stats = array(); for ($i = 1; $i < $days; $i++) { $stats[] = array($i, '0', '0'); $views[$i - 1] = 0; $clicks[$i - 1] = 0; $vLabels[] = $i; } $Qstats = $lC_Database->query('select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from :table_banners_history where banners_id = :banners_id and month(banners_history_date) = :month and year(banners_history_date) = :year'); $Qstats->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY); $Qstats->bindInt(':banners_id', $_id); $Qstats->bindInt(':month', $_month); $Qstats->bindInt(':year', $_year); $Qstats->execute(); while ($Qstats->next()) { $stats[$Qstats->valueInt('banner_day') - 1] = array($Qstats->valueInt('banner_day'), $Qstats->valueInt('value') > 0 ? $Qstats->valueInt('value') : '0', $Qstats->valueInt('dvalue') > 0 ? $Qstats->valueInt('dvalue') : '0'); $views[$Qstats->valueInt('banner_day') - 1] = $Qstats->valueInt('value'); $clicks[$Qstats->valueInt('banner_day') - 1] = $Qstats->valueInt('dvalue'); } $ochart = new chart(600, 350, 5, '#eeeeee'); $ochart->setTitle(sprintf($lC_Language->get('subsection_heading_statistics_daily'), $lC_ObjectInfo->get('banners_title'), @strftime('%B', @mktime(0, 0, 0, $_month)), $_year), '#000000', 2); $ochart->setPlotArea(SOLID, '#444444', '#dddddd'); $ochart->setFormat(0, ',', '.'); $ochart->setXAxis('#000000', SOLID, 1, ''); $ochart->setYAxis('#000000', SOLID, 2, ''); $ochart->setLabels($vLabels, '#000000', 1, VERTICAL); $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); $ochart->addSeries($views, 'area', 'Series1', SOLID, '#000000', '#0000ff'); $ochart->addSeries($clicks, 'area', 'Series1', SOLID, '#000000', '#ff0000'); $ochart->plot('images/graphs/banner_daily-' . $_id . '_' . $_month . '.' . $image_extension); return $stats; }
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example17"); $chart->plot($data, false, "red", "gradient", "black", 5); $chart->stroke(); ?>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example22"); $chart->plot($data4, false, "blue"); $chart->add_legend("Gross", "blue"); $chart->plot($data); $chart->add_legend("Net"); $chart->stroke(); ?>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example20"); $chart->set_grid_color("black", false); $chart->plot($data, false, "blue", "gradient", "black", 7); $chart->plot($data, false, "red", "gradient", "black", 0); $chart->stroke(); ?>
array_push($color_cols, $vo_ch_col->col_color); if ($vo_ch_col->is_label) { array_push($x_label_cols, $col_idx); } if ($vo_ch_col->is_value) { array_push($values_cols, $col_idx); array_push($stacked_label_cols, $vo_ch_col->col_label); array_push($stacked_label_cols_color, $vo_ch_col->col_color); } if ($vo_ch_col->is_time == 1) { array_push($istime_cols, $col_idx); } $col_idx++; } //Create chart $wpbi_chart = new chart($my_test_rows); $wpbi_chart->set_name($vo_chart->chart_name); $wpbi_chart->set_tooltip($vo_chart->chart_tooltip); $wpbi_chart->set_width($vo_chart->chart_width . ($vo_chart->chart_width_percent ? '%' : '')); $wpbi_chart->set_height($vo_chart->chart_height . ($vo_chart->chart_height_percent ? '%' : '')); $wpbi_chart->set_bg_colour($vo_chart->chart_bg_color); $wpbi_chart->set_title($vo_chart->chart_title); $wpbi_chart->set_title_color($vo_chart->chart_title_color); $wpbi_chart->set_title_size($vo_chart->chart_title_size); $wpbi_chart->set_time_format($vo_chart->chart_time_format); $wpbi_chart->set_type($vo_chart->chart_type); $wpbi_chart->set_x_axis_step_percent($vo_chart->chart_x_grid_lines); $wpbi_chart->set_y_axis_step_percent($vo_chart->chart_y_grid_lines); $wpbi_chart->set_x_precision($_POST[$wpbi_settings['parameter']['ch-x-precision']]); $wpbi_chart->set_y_precision($_POST[$wpbi_settings['parameter']['ch-y-precision']]); $wpbi_chart->set_y_range($_POST[$wpbi_settings['parameter']['ch-y-range']]);
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example28"); $chart->plot($data, $data4, "blue", "fillgradient", "black", 0); $chart->stroke(); ?>
$Qstats = $osC_Database->query('select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from :table_banners_history where banners_id = :banners_id and year(banners_history_date) = :year group by banner_month'); $Qstats->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY); $Qstats->bindInt(':banners_id', $_GET['bID']); $Qstats->bindInt(':year', $year); $Qstats->execute(); while ($Qstats->next()) { $stats[$Qstats->valueInt('banner_month') - 1] = array(strftime('%b', mktime(0, 0, 0, $Qstats->valueInt('banner_month'), 1, $year)), $Qstats->valueInt('value') > 0 ? $Qstats->valueInt('value') : '0', $Qstats->valueInt('dvalue') > 0 ? $Qstats->valueInt('dvalue') : '0'); $views[$Qstats->valueInt('banner_month') - 1] = $Qstats->valueInt('value'); $clicks[$Qstats->valueInt('banner_month') - 1] = $Qstats->valueInt('dvalue'); } $vLabels = array(); for ($i = 1; $i < 13; $i++) { $vLabels[] = strftime('%b', mktime(0, 0, 0, $i, 1, $year)); if (!isset($views[$i - 1])) { $views[$i - 1] = 0; } if (!isset($clicks[$i - 1])) { $clicks[$i - 1] = 0; } } $ochart = new chart(600, 350, 5, '#eeeeee'); $ochart->setTitle(sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $Qbanner->value('banners_title'), $year), '#000000', 2); $ochart->setPlotArea(SOLID, '#444444', '#dddddd'); $ochart->setFormat(0, ',', '.'); $ochart->setXAxis('#000000', SOLID, 1, $year); $ochart->setYAxis('#000000', SOLID, 2, ''); $ochart->setLabels($vLabels, '#000000', 1, VERTICAL); $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); $ochart->addSeries($views, 'area', 'Series1', SOLID, '#000000', '#0000ff'); $ochart->addSeries($clicks, 'area', 'Series1', SOLID, '#000000', '#ff0000'); $ochart->plot('images/graphs/banner_monthly-' . $_GET['bID'] . '.' . $image_extension);
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 (1991) as published by the Free Software Foundation. */ require 'external/panachart/panachart.php'; $views = array(); $clicks = array(); $vLabels = array(); $stats = array(); $Qstats = $osC_Database->query('select year(banners_history_date) as year, sum(banners_shown) as value, sum(banners_clicked) as dvalue from :table_banners_history where banners_id = :banners_id group by year'); $Qstats->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY); $Qstats->bindInt(':banners_id', $_GET['bID']); $Qstats->execute(); while ($Qstats->next()) { $stats[] = array($Qstats->valueInt('year'), $Qstats->valueInt('value') > 0 ? $Qstats->valueInt('value') : '0', $Qstats->valueInt('dvalue') > 0 ? $Qstats->valueInt('dvalue') : '0'); $views[] = $Qstats->valueInt('value'); $clicks[] = $Qstats->valueInt('dvalue'); $vLabels[] = $Qstats->valueInt('year'); } $ochart = new chart(600, 350, 5, '#eeeeee'); $ochart->setTitle(sprintf($osC_Language->get('subsection_heading_statistics_yearly'), $osC_ObjectInfo->get('banners_title')), '#000000', 2); $ochart->setPlotArea(SOLID, '#444444', '#dddddd'); $ochart->setFormat(0, ',', '.'); $ochart->setXAxis('#000000', SOLID, 1, ''); $ochart->setYAxis('#000000', SOLID, 2, ''); $ochart->setLabels($vLabels, '#000000', 1, VERTICAL); $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); $ochart->addSeries($views, 'area', 'Series1', SOLID, '#000000', '#0000ff'); $ochart->addSeries($clicks, 'area', 'Series1', SOLID, '#000000', '#ff0000'); $ochart->plot('images/graphs/banner_yearly-' . $_GET['bID'] . '.' . $osC_Template->image_extension);
$pdf->AddPage($_SESSION[pdf_layout]); $pdf->AliasNbPages(); $pdf->SetFont('Arial', '', 8); $data = $pdf->LoadData('EXPORT_REPORT.csv'); $pdf->ColorTable($header, $data); if ($_SESSION[create_graph] == "yes") { $_SESSION[no_header] = "yes"; $pdf->AddPage($_SESSION[pdf_layout]); $pdf->AliasNbPages(); $pdf->SetFont('Arial', '', 8); require "chart.php"; $data = explode(",", $pdf_graph_values); if ($_SESSION[pdf_layout] == "P") { $chart = new chart(535, 720); } elseif ($_SESSION[pdf_layout] == "L") { $chart = new chart(785, 485); } if ($_SESSION[pdf_graph_title] != "") { $chart->set_title("{$_SESSION['pdf_graph_title']}"); } if ($_SESSION[pdf_graph] == "line_graph") { $chart->plot($data, false, "black"); } elseif ($_SESSION[pdf_graph] == "bar_graph") { $chart->plot($data, false, "black", "impulse"); } elseif ($_SESSION[pdf_graph] == "box_graph") { $chart->plot($data, false, "gray", "box", "black"); } $chart->stroke(); $pdf->Ln(); if ($_SESSION[pdf_layout] == "P") { $pdf->Image("pdf_image.png", 10, 20);
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example27"); $chart->set_font("/usr/share/texmf/fonts/type1/adobe/utopia/putb8a.pfb", "type1", 16); $chart->set_title("A Big Utopia"); $chart->plot($data); $chart->stroke(); ?>
the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ $now = time(); require "chart/chart.php"; $chart = new chart(640, 480); $chart->set_margins(60, 10, 10, 46); $chart->set_expired(true); $chart->set_x_ticks(1, "ctime"); $chart->set_labels("Time", "Vote sum"); $chart->set_extrema(-1, 1); $start = $graph[0][0]; $end = $graph[count($graph) - 1][0]; function separate_xy($points) { $xs = array(); $ys = array(); foreach ($points as $point) { $xs[] = $point[0]; $ys[] = $point[1]; }
$percentage[$i] = ($am[$i]/$total) * 100; } $ochart = new chart(600,320,5, '#eeeeee'); //chart($width, $height, $margin, $backgroundColor) $ochart->setTitle('Percentage Distribution of Properties (Tax Payment)','#000000',2); //setTitle($title, $textColor, $font) $ochart->setPlotArea(SOLID,'#444444', '#dddddd'); //setPlotArea($style, $strokeColor, $fillColor) $ochart->setFormat(0,',','.'); //setFormat($numberOfDecimals, $thousandsSeparator, $decimalSeparator) $ochart->setXAxis('#000000', SOLID, 1, 'Barangay'); //setXAxis($color, $style, $font, $title) $ochart->setYAxis('#000000', SOLID, 2, 'Tax Payment'); //setYAxis($color, $style, $font, $title) $ochart->setLabels($bar, '#000000', 1, VERTICAL); //setLabels(&$labels, $textColor, $font, $direction) $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); //setGrid($colorHorizontal, $styleHorizontal, $colorVertical, $styleVertical) $ochart->addSeries($percentage,'bar','', SOLID,'#000000', '#0000ff'); //addSeries(&$values, $plotType, $title, $style, $strokeColor, $fillColor) $ochart->plot('graphs/2.png'); //plot($file) */ $ochart = new chart(600,320,5, '#eeeeee'); //chart($width, $height, $margin, $backgroundColor) $ochart->setTitle(' Distribution of Properties (Tax Payment)','#000000',2); //setTitle($title, $textColor, $font) $ochart->setPlotArea(SOLID,'#444444', '#dddddd'); //setPlotArea($style, $strokeColor, $fillColor) $ochart->setFormat(0,',','.'); //setFormat($numberOfDecimals, $thousandsSeparator, $decimalSeparator) $ochart->setXAxis('#000000', SOLID, 1, 'Barangay'); //setXAxis($color, $style, $font, $title) $ochart->setYAxis('#000000', SOLID, 2, 'Tax Payment'); //setYAxis($color, $style, $font, $title) $ochart->setLabels($bar, '#000000', 1, VERTICAL); //setLabels(&$labels, $textColor, $font, $direction) $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); //setGrid($colorHorizontal, $styleHorizontal, $colorVertical, $styleVertical) $ochart->addSeries($am,'bar','', SOLID,'#000000', '#0000ff'); //addSeries(&$values, $plotType, $title, $style, $strokeColor, $fillColor) $ochart->plot('graphs/3.png'); //plot($file) */ $out = fopen("viewGraphs.php", "w"); // fwrite($out,"<a href='t.php'>Back</a><br>"); fwrite($out, "<table cellspacing=5 cellpadding=4 border=0 align='center'>"); for($i=2; $i<=3; $i++){ $sout.='<tr><td><img border=0 src="graphs/'.$i.'.png"></td></tr>';
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Chart Test</title> </head> <body> <h4>Modulus Video Chart:</h4> <?php $mygraph = new chart(300, 200); $mygraph->plot($data); $mygraph->stroke(); ?> </body> </html>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example5"); $chart->plot($data); $chart->set_labels("Day", "Money"); $chart->stroke(); ?>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example24"); $chart->plot($data, false, "gray", "triangle", "black"); $chart->stroke(); ?>
<?php /* accounts/charts/delete-process.php access: account_charts_write Deletes an account provided that the account has not been added to any invoices. */ // includes require "../../include/config.php"; require "../../include/amberphplib/main.php"; // custom includes require "../../include/accounts/inc_charts.php"; if (user_permissions_get('accounts_charts_write')) { $obj_chart = new chart(); /* Load POST Data */ $obj_chart->id = @security_form_input_predefined("int", "id_chart", 1, ""); // these exist to make error handling work right $data["code_chart"] = @security_form_input_predefined("any", "code_chart", 0, ""); $data["description"] = @security_form_input_predefined("any", "description", 0, ""); // confirm deletion $data["delete_confirm"] = @security_form_input_predefined("any", "delete_confirm", 1, "You must confirm the deletion"); /* Error Handling */ // make sure the chart actually exists if (!$obj_chart->verify_id()) {
<?php $task = $_REQUEST['task']; //parameter yang dikirim oleh js $handler->loadModel("chart_m"); //model di core $chart = new chart(true); switch ($task) { case 'getChart': echo $chart->getChart($_REQUEST); //pake $_REQUEST juga sama aja break; }
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example4"); $chart->plot($data); $chart->set_frame(); $chart->stroke(); ?>
$width = 600; $height = 200; } if ($_GET[tam] == "peq") { $width = 300; $height = 100; } if ($_GET[tam] == "mini") { $width = 200; $height = 100; } // Creamos el tamaño de la imagen //$chart = new chart($width, $height); $hora = date("i"); $nombrecache = "ticker-" . $_GET["ticker"] . "-" . $_GET["tam"] . "-" . $_GET["dias"] . "-" . $hora; $chart = new chart($width, $height, $nombrecache . ".png"); // Elegimos que media móvil dibujar if ($_GET[mm3]) { $chart->plot($mm3, false, "red"); $chart->add_legend("MM3", "red"); } if ($_GET[mm10]) { $chart->plot($mm10, false, "green"); $chart->add_legend("MM10", "green"); } //Dibujamos el cierre if ($_GET[cierre]) { $chart->plot($cierre, false, "black", "cross", false, 4); } //Dibujamos apertura if ($_GET[apertura]) {
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example23"); $chart->plot($data); $chart->set_extrema(9, 81); $chart->stroke(); ?>
<?php include "classes/table2array.php"; include "classes/chart.php"; include "classes/color.php"; $table = file_get_contents('tables/' . $_GET['table'] . '.htm'); $value = json_decode($_GET['value'], true); // value_columns $lang = $_GET['lang']; $chart = new chart($table, $lang); list($type, $data) = $chart->create_graph(); echo 'Row length<br>'; print_r($chart->row_count); echo '<br><br>'; echo 'Col length<br>'; print_r($chart->col_count); echo '<br><br>'; echo 'Array_structure<br>'; print_r($chart->array_structure); echo '<br><br>'; echo 'Column_structure<br>'; print_r($chart->column_structure); echo '<br><br>'; echo 'Column_titles<br>'; print_r($chart->column_titles); echo '<br><br>'; //echo $type.'<br>'.$data; if (count($value) > 0) { $data_array = json_decode($data, true); $data_new = $data_array; $data_new[datasets] = "";
function UserTrafficPeriodGB() { require 'lib/charts.class.php'; global $SAMSConf; global $DATE; global $USERConf; global $SquidUSERConf; $elemx = array(); $elemy = array(); if (isset($_GET["id"])) { $id = $_GET["id"]; } $SquidUSERConf = new SAMSUSER(); $SquidUSERConf->sams_user($id); if ($USERConf->ToWebInterfaceAccess("GSC") != 1 && ($USERConf->s_user_id != $SquidUSERConf->s_user_id && $USERConf->ToWebInterfaceAccess("W") != 1)) { exit(0); } $DB = new SAMSDB(); $g = new chart(); $lang = "./lang/lang.{$SAMSConf->LANG}"; require $lang; $sdate = $DATE->sdate(); $edate = $DATE->edate(); $bdate = $DATE->BeginDate(); $eddate = $DATE->EndDate(); $QUERY = "SELECT sum(s_size) as s_size,s_date,s_user,s_domain,sum(s_hit) as s_hit FROM cachesum WHERE lower(s_user)=lower('" . $SquidUSERConf->s_nick . "') AND s_date>='{$sdate}' AND s_date<='{$edate}' GROUP BY s_date,s_user,s_domain ORDER BY s_date"; $num_rows = $DB->samsdb_query_value($QUERY); while ($row = $DB->samsdb_fetch_array()) { $elemx[0][] = $row['s_date']; $elemx[1][] = $row['s_date']; $elemy[0][] = $row['s_size']; $elemy[1][] = $row['s_hit']; } $xcount = 0; foreach ($elemx as $v) { $xcount = max($xcount, count($v)); } $ymax = 0; foreach ($elemy as $v) { $ymax = max($ymax, ceil(max($v))); } $diff = array_sum($elemy[0]) - array_sum($elemy[1]); foreach ($elemy as $k => $v) { foreach ($v as $kk => $vv) { $g->xValue[$k][] = $elemx[$k][$kk]; $g->DataValue[$k][] = $vv; } } $g->Title = ""; $g->SubTitle = " "; $g->Width = $xcount * 45 + 75; $g->Height = 300; $g->ShowBullets = TRUE; $g->LineShowCaption = FALSE; // TO BE FIXED YET $g->LineShowTotal = FALSE; // DEPENDS ON LineShowCaption to be TRUE $g->LineCaption[0] = "Period 1"; $g->LineCaption[1] = "Period 2"; $g->LineCount = 2; $g->xCount = $xcount; $g->xCaption = " "; $g->xShowValue = TRUE; $g->xShowGrid = TRUE; $g->yCount = 10; $g->yCaption = "Daily traffic (bytes)"; $g->yShowValue = TRUE; $g->yShowGrid = TRUE; $g->DataDecimalPlaces = 0; $g->DataMax = $ymax; $g->DataMin = 0; $g->DataShowValue = FALSE; // #ITS DRAWING TIME################################ $g->MakeLinePointChart(); // ################################################# }
/** * (non-PHPdoc) * @see chart::buildChart() */ function buildChart() { parent::buildChart(); $this->buildxyAxis(); $this->chart->set_x_axis($this->xAxis); $this->chart->add_y_axis($this->yAxis); if ($this->tagPercent && !empty($this->tags)) { $this->chart->add_element($this->tags); } }
$barangay[$i] = $db->f("description"); } } /*for($i=0;$i<count($t);$i++){ $percentage[$i] = ($t[$i]/$total) * 100; }*/ //$vCht4 = array(1,20,20,34,5,52,41,20,34,43,64,40); // $vCht5 = array(12,21,36,27,14,23,3,5,29,23,12,5); // $vCht6 = array(5,7,3,15,7,8,2,2,2,11,22,3); // $vLabels = array('Jan','Feb','Mar','Apr','May','Jun','Jul' //,'Aug','Sep','Oct','Nov','Dec'); if(is_array($barangay)){ $ochart = new chart(400,250,5, '#eeeeee'); //chart($width, $height, $margin, $backgroundColor) $ochart->setTitle('Statistics on Property Locations (By Classification: Market Value)','#000000',2); //setTitle($title, $textColor, $font) $ochart->setPlotArea(SOLID,'#444444', '#dddddd'); //setPlotArea($style, $strokeColor, $fillColor) $ochart->setFormat(0,',','.'); //setFormat($numberOfDecimals, $thousandsSeparator, $decimalSeparator) $ochart->setXAxis('#000000', SOLID, 1, 'Classification'); //setXAxis($color, $style, $font, $title) $ochart->setYAxis('#000000', SOLID, 2, 'Amount'); //setYAxis($color, $style, $font, $title) $ochart->setGrid('#bbbbbb', DASHED, '#bbbbbb', DOTTED); //setGrid($colorHorizontal, $styleHorizontal, $colorVertical, $styleVertical) $ochart->setLabels($barangay, '#000000', 1, VERTICAL); //setLabels(&$labels, $textColor, $font, $direction) $ochart->addSeries($t,'bar','', SOLID,'#000000', '#0000ff'); //addSeries(&$values, $plotType, $title, $style, $strokeColor, $fillColor) $ochart->plot('graphs/'.$brgyID.''.$classification.'img.png'); //plot($file) $out = fopen("viewGraphs.php", "w"); //fwrite($out,"<a href='t.php'>Back</a><br>"); fwrite($out, "<table cellspacing=5 cellpadding=4 border=0 align='center'>"); // for($i=4; $i<=4; $i++){
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example3-1"); $chart->plot($data, false, "white"); $chart->set_grid_color("black"); $chart->set_background_color("blue", "ForestGreen"); $chart->set_title("Title, background and border"); $chart->stroke(); ?>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example26"); $chart->set_font("/usr/share/texmf/fonts/type1/adobe/utopia/putb8a.pfb", "type1"); $chart->set_title("Using The Adobe Utopia Font"); $chart->plot($data); $chart->stroke(); ?>
<?php require 'chart.php'; require 'data.php'; $chart = new chart(300, 200, "example9"); $chart->plot($data, false, "black", "impulse"); $chart->stroke(); ?>