function test_case($case) { global $cases, $test_verbose, $n_tests, $n_pass, $n_fail, $test_save; $n_tests++; extract($cases[$case]); $title = "Test case {$n_tests}: {$data_type} (should match {$like})"; # Make a data array that is valid (but not necessarily reasonable) # for any data type. One works for all except pie chart. if (!empty($pie)) { $plot_type = 'pie'; $data = array(array('', 1), array('', 1), array('', 2)); } else { $plot_type = 'lines'; # Valid for text-data, data-data, and data-data-error: $data = array(array('', 1, 2, 2, 2), array('', 2, 4, 1, 1), array('', 3, 5, 2, 2)); } $p1 = new PHPlot(400, 300); $p1->SetFailureImage(False); $p1->SetPrintImage(False); $p1->SetDataValues($data); $p1->SetDataType($data_type); // Alias data type $p1->SetPlotType($plot_type); $p1->DrawGraph(); $p1_image = $p1->EncodeImage('raw'); if ($test_save) { file_put_contents("dta-{$case}a_{$data_type}.png", $p1_image); } $p2 = new PHPlot(400, 300); $p2->SetFailureImage(False); $p2->SetPrintImage(False); $p2->SetDataValues($data); $p2->SetDataType($like); // Base data type - alias should match this $p2->SetPlotType($plot_type); $p2->DrawGraph(); $p2_image = $p2->EncodeImage('raw'); if ($test_save) { file_put_contents("dta-{$case}b_{$like}.png", $p2_image); } if ($p1_image == $p2_image) { $n_pass++; if ($test_verbose) { echo "Pass: {$title}\n"; } } else { $n_fail++; echo "FAIL - Image Mismatch: {$title}\n"; } }
function graficoBarra($data, $archivo = "", $meta_data = array('titulo' => 'Sin Título', 'tituloX' => 'Eje X', 'tituloY' => 'Eje Y', 'color' => 'SkyBlue', 'width' => 800, 'height' => 600, 'angle' => 45), $legend = array("Datos")) { # Objeto que crea el gráfico y su tama?o $plot = new PHPlot($meta_data['width'], $meta_data['height']); $plot->SetImageBorderType('plain'); # Setea el archivo donde se guarda la imagen generada y no permite la visualización inmediata $plot->SetPrintImage(false); $plot->SetFileFormat("jpg"); $plot->SetOutputFile($archivo); $plot->SetIsInline(true); # Envio de datos $plot->SetDataValues($data); # Tipo de gráfico y datos $plot->SetDataType("text-data"); $plot->SetPlotType("bars"); # Setiando el True type font //$plot->SetTTFPath(TTFPath); //$plot->SetUseTTF(TRUE); $plot->SetAxisFontSize(2); $plot->SetVertTickIncrement(7); //$plot->SetXTickLength(7); //$plot->SetDataColors($meta_data['color']); $plot->SetDataColors(array($meta_data['color'], 'red', 'white')); $plot->SetLegendPixels(1, 1); $plot->SetLegend($legend); # Etiquetas del eje Y: $plot->SetYTitle($meta_data['tituloY']); $plot->SetYDataLabelPos('plotin'); # Título principal del gráfico: $plot->SetTitle($meta_data['titulo']); # Etiquetas eje X: $plot->SetXTitle($meta_data['tituloX']); if (isset($meta_data['angle'])) { $plot->SetXLabelAngle($meta_data['angle']); } else { $plot->SetXLabelAngle(45); } $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); # Método que dibuja el gráfico $plot->DrawGraph(); $plot->PrintImage(); }
function plotGraph($data) { //Define the object $plot = new PHPlot(); $example_data = $data; $plot->SetDataValues($example_data); $plot->SetDataType('data-data'); //Set titles $plot->SetTitle("temp and humi"); $plot->SetXTitle('time'); $plot->SetYTitle('Y Data'); $legend = array('temp', 'humi'); $plot->SetLegend($legend); $plot->SetXDataLabelAngle(90); //$plot->SetXGridLabelType("time"); $plot->SetXTickLabelPos('xaxis'); $plot->SetXTickPos('plotdown'); $plot->SetXLabelType('time', '%H:%M'); $plot->TuneXAutoTicks(10, 'date'); // $plot->SetXTickIncrement(.5); //$plot->SetXTickIncrement(60 * 24); $plot->SetPlotType('lines'); //$plot->SetPlotAreaWorld(strtotime('00:00'), null, strtotime('23:59'), null); $plot->SetDrawXGrid(true); //Draw it $plot->DrawGraph(); }
public function doGet(WebAppRequest $req, WebAppResponse $res) { // Bootstraps Innomatic require_once 'innomatic/core/InnomaticContainer.php'; $innomatic = InnomaticContainer::instance('innomaticcontainer'); // Sets Innomatic base URL $baseUrl = ''; $webAppPath = $req->getUrlPath(); if (!is_null($webAppPath) && $webAppPath != '/') { $baseUrl = $req->generateControllerPath($webAppPath, true); } $innomatic->setBaseUrl($baseUrl); $innomatic->setInterface(InnomaticContainer::INTERFACE_WEB); $home = WebAppContainer::instance('webappcontainer')->getCurrentWebApp()->getHome(); $innomatic->bootstrap($home, $home . 'core/conf/innomatic.ini'); $id = basename($req->getParameter('id')); //$id = basename($_GET['id']); $args = unserialize(file_get_contents(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id)); require_once 'phplot/PHPlot.php'; $graph = new PHPlot($args['width'], $args['height']); $graph->SetIsInline('1'); //$graph->SetDataColors( array("blue",'white'),array("black") ); //$graph->$line_style = array('dashed','dashed','solid','dashed','dashed','solid'); // Base $graph->SetDataValues($args['data']); $graph->SetPlotType($args['plottype']); // Appearance $graph->SetPointShape($args['pointshape']); $graph->SetPointSize($args['pointsize']); $graph->SetTitle($args['title']); // Color $graph->SetBackgroundColor($args['backgroundcolor']); $graph->SetGridColor($args['gridcolor']); if (count($args['legend'])) { $graph->SetLegend($args['legend']); } $graph->SetLineWidth($args['linewidth']); $graph->SetTextColor($args['textcolor']); $graph->SetDataColors(array(array(145, 165, 207), array(114, 167, 112), array(71, 85, 159), array(175, 83, 50), array(247, 148, 53), array(240, 231, 125), array(154, 204, 203), array(201, 164, 196)), 'black'); //$graph->data_color = array( array(145,165,207), array(114,167,112), array(71,85,159), array(175,83,50), array(247,148,53), array(240,231,125), array(154,204,203), array(201,164,196) ); //array('blue','green','yellow','red','orange'); $graph->DrawGraph(); unlink(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id); }
function testBars() { # PHPlot Example: Bar chart, 3 data sets, unshaded $data = array(array('Jan', 40, 2, 4), array('Feb', 30, 3, 4), array('Mar', 20, 4, 4), array('Apr', 10, 5, 4), array('May', 3, 6, 4), array('Jun', 7, 7, 4), array('Jul', 10, 8, 4), array('Aug', 15, 9, 4), array('Sep', 20, 5, 4), array('Oct', 18, 4, 4), array('Nov', 16, 7, 4), array('Dec', 14, 3, 4)); $plot = new PHPlot(800, 600); $plot->SetIsInline(true); $plot->SetImageBorderType('plain'); $plot->SetPlotType('bars'); $plot->SetDataType('text-data'); $plot->SetDataValues($data); # Main plot title: $plot->SetTitle('Unshaded Bar Chart with 3 Data Sets'); # No 3-D shading of the bars: $plot->SetShading(0); # Make a legend for the 3 data sets plotted: $plot->SetLegend(array('Engineering', 'Manufacturing', 'Administration')); # Turn off X tick labels and ticks because they don't apply here: $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); $plot->DrawGraph(); }
function make_plot($plot_type, $data_type, $nx, $ny) { $plot = new PHPlot(1280, 1024); $plot->SetPrintImage(False); $plot->SetFailureImage(False); $plot->SetDataType($data_type); $plot->SetDataValues(make_data_array($plot_type, $data_type, $nx, $ny, 100)); $plot->SetPlotType($plot_type); $plot->SetTitle("Serialize/Unserialize Tests\n{$plot_type} - {$data_type}"); $plot->SetXTickIncrement(5); $plot->SetYTickIncrement(10); $plot->SetPlotBorderType('full'); $plot->SetDrawXGrid(True); $plot->SetDrawYGrid(True); $plot->SetXTitle('X Axis Title'); $plot->SetYTitle('Y Axis Title'); # Select data labels or tick labels based on data type: if ($data_type == 'data-data') { $plot->SetXDataLabelPos('none'); $plot->SetXTickLabelPos('plotdown'); $plot->SetXTickPos('plotdown'); } elseif ($data_type == 'text-data') { $plot->SetXDataLabelPos('plotdown'); $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); } elseif ($data_type == 'data-data-yx') { $plot->SetYDataLabelPos('none'); $plot->SetYTickLabelPos('plotleft'); $plot->SetYTickPos('plotleft'); } elseif ($data_type == 'text-data-yx') { $plot->SetYDataLabelPos('plotleft'); $plot->SetYTickLabelPos('none'); $plot->SetYTickPos('none'); } return $plot; }
eval("\$data[\$i] = \$data_row{$i}; "); } } else { foreach ($data_row0 as $key => $val) { $data[$key] = array($data_row0[$key], $data_row1[$key], $data_row2[$key], $data_row3[$key], $data_row4[$key]); } } } } //////////////////////////////////////////////// //Required Settings include "../phplot.php"; $graph = new PHPlot($xsize_in, $ysize_in); $graph->SetDataType($which_data_type); // Must be first thing $graph->SetDataValues($data); //Optional Settings (Don't need them) // $graph->SetTitle("This is a\n\rmultiple line title\n\rspanning three lines."); $graph->SetTitle($title); $graph->SetXTitle($xlbl, $which_xtitle_pos); $graph->SetYTitle($ylbl, $which_ytitle_pos); $graph->SetLegend(array("A", "Bee", "Cee", "Dee")); $graph->SetFileFormat($which_fileformat); $graph->SetPlotType($which_plot_type); $graph->SetUseTTF($which_use_ttf); $graph->SetYTickIncrement($which_yti); $graph->SetXTickIncrement($which_xti); $graph->SetXTickLength($which_xtl); $graph->SetYTickLength($which_ytl); $graph->SetXTickCrossing($which_xtc); $graph->SetYTickCrossing($which_ytc);
$allDaysKey++; //print"<font color=red>$prevDay=$mkday</font><br>"; } $prevDay = $mkday; $prevDOfMonth = $DayOfMonth; } if ($debug) { print_r($allDays); } if ($debug) { print "I" . $maxValue . "I"; } include "../include/phplot/phplot.php"; $graph = new PHPlot(600, 300); $graph->SetDataType("text-data"); $graph->SetDataValues($allDays); $graph->SetYTickIncrement(); $graph->y_tick_increment = ceil(@$graph->y_tick_increment); $graph->SetXLabelType("time"); $graph->SetXTimeFormat("%b %d"); if ($incoming == '2') { $graph->SetLegend(array("Outgoing")); $graph->SetDataColors(array('green')); } elseif ($incoming == '3') { $graph->SetLegend(array("Incoming")); $graph->SetDataColors(array('orange')); } else { $graph->SetLegend(array("All", "Outgoing", "Incoming")); } $graph->SetYTitle("Quantity of calls"); $graph->SetPlotType("bars");
/** * Adds raw image data of the graph to the output. * @param $opts FormOptions */ public function draw( FormOptions $opts ) { global $wgTranslatePHPlotFont, $wgLang; $width = $opts->getValue( 'width' ); $height = $opts->getValue( 'height' ); // Define the object $plot = new PHPlot( $width, $height ); list( $legend, $resData ) = $this->getData( $opts ); $count = count( $resData ); $skip = intval( $count / ( $width / 60 ) - 1 ); $i = $count; foreach ( $resData as $date => $edits ) { if ( $skip > 0 ) { if ( ( $count - $i ) % $skip !== 0 ) $date = ''; } if ( strpos( $date, ';' ) !== false ) { list( , $date ) = explode( ';', $date, 2 ); } array_unshift( $edits, $date ); $data[] = $edits; $i--; } $font = FCFontFinder::find( $wgLang->getCode() ); if ( $font ) { $plot->SetDefaultTTFont( $font ); } else { $plot->SetDefaultTTFont( $wgTranslatePHPlotFont ); } $plot->SetDataValues( $data ); if ( $legend !== null ) { $plot->SetLegend( $legend ); } $numberFont = FCFontFinder::find( 'en' ); $plot->setFont( 'x_label', $numberFont, 8 ); $plot->setFont( 'y_label', $numberFont, 8 ); $yTitle = wfMsg( 'translate-stats-' . $opts['count'] ); // Turn off X axis ticks and labels because they get in the way: $plot->SetYTitle( $yTitle ); $plot->SetXTickLabelPos( 'none' ); $plot->SetXTickPos( 'none' ); $plot->SetXLabelAngle( 45 ); $max = max( array_map( 'max', $resData ) ); $max = self::roundToSignificant( $max, 1 ); $max = round( $max, intval( -log( $max, 10 ) ) ); $yTick = 10; while ( $max / $yTick > $height / 20 ) { $yTick *= 2; } // If we have very small case, ensure that there is at least one tick $yTick = min( $max, $yTick ); $yTick = self::roundToSignificant( $yTick ); $plot->SetYTickIncrement( $yTick ); $plot->SetPlotAreaWorld( null, 0, null, $max ); $plot->SetTransparentColor( 'white' ); $plot->SetBackgroundColor( 'white' ); // Draw it $plot->DrawGraph(); }
$plot->SetFontTTF('x_title', $font, 14); $plot->SetFontTTF('y_title', $font, 10); # Disable auto-output: $plot->SetPrintImage(0); $title = "Test {$n_plots} Plots with TTF Title (sequence {$title_sequence})"; $y1 = $title_space; // Top of plot area for ($i = 0; $i < $n_plots; $i++) { if ($i == $title_sequence) { $plot->SetTitle($title); } $y2 = $y1 + $height_of_each_plot; // Bottom of plot area # fwrite(STDERR, "Plot $i area: min=(80, $y1) : max=(740, $y2)\n"); $plot->SetPlotAreaPixels(80, $y1, 740, $y2); $plot->SetDataType('text-data'); $plot->SetDataValues($report[$i]); $plot->SetPlotAreaWorld(NULL, 0, NULL, $max_x); $plot->SetDataColors(array('blue')); $plot->SetXTickLabelPos('none'); $plot->SetXDataLabelPos('plotdown'); $plot->SetXTickPos('plotdown'); $plot->SetYTickIncrement(1); $plot->SetXTitle("Chart {$i} X Values"); $plot->SetYTitle("Chart {$i} Y Values"); $plot->SetPlotType('bars'); $plot->DrawGraph(); $y1 = $y2 + $space_below_plots; // Start next plot below last plot } $plot->PrintImage();
$cumulateddata = array(); $max = 1; foreach ($stats->getTimestats($term, $REX['ADDON']['rexsearch_plugins'][$parent][$mypage]['settings']['searchtermselectmonthcount']) as $month) { $bardata[] = array(date('M', mktime(0, 0, 0, $month['m'], 1, 2010)) . "\n" . $month['count'], $month['count']); if ($month['count'] > $max) { $max = $month['count']; } } $title = $I18N->Msg('a587_stats_searchterm_timestats_title', empty($term) ? $I18N->Msg('a587_stats_searchterm_timestats_title0_all') : $I18N->Msg('a587_stats_searchterm_timestats_title0_single', $term), intval($_GET['monthcount'])); if (rex_lang_is_utf8()) { $title = utf8_decode($title); } // draw bars $plot = new PHPlot(700, 240); $plot->SetImageBorderType('none'); $plot->SetTransparentColor('white'); $plot->SetMarginsPixels(NULL, NULL, 26, NULL); # Make sure Y axis starts at 0: $plot->SetPlotAreaWorld(NULL, 0, NULL, NULL); $len = strlen('' . $max); $plot->SetYTickIncrement(max(1, ceil($max / pow(10, $len - 1)) * pow(10, $len - 2))); # Main plot title: $plot->SetTitle($title); $plot->SetFont('title', 3); // draw bars $plot->SetPlotType('bars'); $plot->SetDataType('text-data'); $plot->SetDataValues($bardata); $plot->SetDataColors(array('#14568a', '#2c8ce0', '#dfe9e9')); $plot->SetShading(ceil(48 / $REX['ADDON']['rexsearch_plugins'][$parent][$mypage]['settings']['searchtermselectmonthcount'])); $plot->DrawGraph();
<?php //Include the code include "../phplot.php"; //Define the object $graph = new PHPlot(); //Define some data include "./data.php"; $graph->SetDataValues($example_data); //Don't print until we say so $graph->SetPrintImage(0); //Draw it $graph->DrawGraph(); //Define some colors $ndx_color = $graph->SetIndexColor("blue"); $ndx_color1 = $graph->SetIndexColor("orange"); //The image data colors are now ndx_data_color[] $graph->DrawDashedLine(250, $graph->plot_area[1], 250, 250, 4, 0, $graph->ndx_data_color[0]); $graph->DrawDashedLine($graph->xtr(5), $graph->ytr(12), $graph->xtr(20), $graph->ytr(42), 5, 3, $ndx_color); $graph->DrawDashedLine($graph->plot_area[0], 250, $graph->plot_area[2], 250, 2, 0, $ndx_color1); $graph->DrawDashedLine($graph->plot_area[0], 251, $graph->plot_area[2], 251, 2, 0, $ndx_color1); //Now print the image $graph->PrintImage();
<?php # $Id$ # Testing PHPlot - Bad data range with SetPlotAreaWorld - baseline/master # Other scripts set $spaw and $subtitle and then include this script. require 'phplot.php'; if (empty($spaw)) { $spaw = array(20, 20, 200, 200); } // Args to SetPlotAreaWorld if (empty($subtitle)) { $subtitle = 'Baseline(no error)'; } // Subtitle for plot $plot = new PHPlot(); $plot->SetTitle("SetPlotAreaWorld(" . implode(', ', $spaw) . ")\n{$subtitle}"); $plot->SetDataType('data-data'); $plot->SetDataValues(array(array('', 25, 25), array('', 195, 195))); $plot->SetPlotType('lines'); call_user_func_array(array($plot, 'SetPlotAreaWorld'), $spaw); $plot->DrawGraph();
<?php # $Id$ # From: PHPlot Quickstart - 1 //Include the code require_once 'phplot.php'; //Define the object $plot = new PHPlot(); //Define some data $example_data = array(array('a', 3), array('b', 5), array('c', 7), array('d', 8), array('e', 2), array('f', 6), array('g', 7)); $plot->SetDataValues($example_data); //Turn off X axis ticks and labels because they get in the way: $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); //Draw it $plot->DrawGraph();
public function renderLot() { $grafico = new PHPlot(800, 600); $grafico->SetFileFormat("jpg"); $grafico->SetIsInline(True); #Indicamos o títul do gráfico e o título dos dados no eixo X e Y do mesmo $grafico->SetTitle($this->data->titulo); $grafico->SetXTitle($this->data->eixoX); $grafico->SetYTitle($this->data->eixoY); #passamos o tipo de gráfico escolhido if (!$this->data->tipoLot) { $this->data->tipoLot = 'bars'; } $grafico->SetPlotType($this->data->tipoLot); switch ($this->data->tipoLot) { case 'pie': $grafico->SetPieLabelType('index', 'custom', 'mycallback'); $grafico->SetDataType('text-data-single'); break; case 'stackedbars': $grafico->SetDataType('text-data-yx'); break; case 'bubbles': $grafico->SetDataType('data-data-xyz'); break; } $grafico->SetLegend($column_names); #Definimos os dados do gráfico switch ($this->data->tipoLot) { case 'pie': $dados = array(array($this->data->x1, $this->data->y11), array($this->data->x2, $this->data->y21), array($this->data->x3, $this->data->y31), array($this->data->x4, $this->data->y41)); break; default: $dados = array(array($this->data->x1, $this->data->y11, $this->data->y12, $this->data->y13), array($this->data->x2, $this->data->y21, $this->data->y22, $this->data->y23), array($this->data->x3, $this->data->y31, $this->data->y32, $this->data->y33), array($this->data->x4, $this->data->y41, $this->data->y42, $this->data->y43)); break; } $grafico->SetDataValues($dados); #Salvamos o gráfico $caminho = \Manager::getFilesPath(); $fileName = uniqid() . '.jpg'; $grafico->SetOutputFile($caminho . '/' . $fileName); $grafico->SetIsInline(True); $grafico->DrawGraph(); #obtemos o endereco do grafico $this->data->locate = \Manager::getDownloadURL('files', basename($fileName), true); }
function BuatBarGraph($filetujuan, $prevtahun, $tahun, $arrStatusAplikan, $urutan, $gel) { $arrPrevTotal = array(); $arrCurTotal = array(); FillArrayPeriod($arrPrevTotal, $arrStatusAplikan, $prevtahun, $gel); FillArrayPeriod($arrCurTotal, $arrStatusAplikan, $tahun, $gel); $maxPrevHeight = 0; $maxCurHeight = 0; foreach ($arrStatusAplikan as $stat) { $data[] = array($stat, $arrPrevTotal[$stat], $arrCurTotal[$stat]); $maxPrevHeight = $maxPrevHeight < $arrPrevTotal[$stat] ? $arrPrevTotal[$stat] : $maxPrevHeight; $maxCurHeight = $maxCurHeight < $arrCurTotal[$stat] ? $arrCurTotal[$stat] : $maxCurHeight; } $plot = new PHPlot(800, 600); //$plot->SetImageBorderType('raised'); $plot->SetFont('y_label', 5); $plot->SetFont('x_label', 5); $plot->SetFont('title', 5); $plot->SetFont('legend', 5); $plot->setShading(10); $plot->SetPlotType('bars'); $plot->SetDataType('text-data'); $plot->SetDataValues($data); $plot->SetTitle('GRAFIK & DATA PMB GEL SISIPAN'); $plot->SetLegend(array($prevtahun, $tahun)); $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); $maxHeight = $maxPrevHeight < $maxCurHeight ? $maxCurHeight : $maxPrevHeight; $increment = $maxHeight <= 50 ? 5 : ($maxHeight <= 100 ? 10 : ($maxHeight <= 500 ? 50 : 100)); $plot->SetYTickIncrement($increment); $plot->SetYDataLabelPos('plotin'); $plot->SetIsInline(true); $plot->SetOutputFile($filetujuan); $plot->DrawGraph(); }
function BuatPieGraph($filetujuan, $prevtahun, $tahun, $urutan, $gel) { $fg = GetaField("pmb b left outer join pmbperiod p on b.PMBPeriodID=p.PMBPeriodID and b.KodeID=p.KodeID and LEFT(p.PMBPeriodID, 4)='{$tahun}'", "(b.TahunLulus='{$prevtahun}' or b.TahunLulus='{$tahun}') and b.KodeID", KodeID, "count(b.PMBID)"); $nfg = GetaField("pmb b left outer join pmbperiod p on b.PMBPeriodID=p.PMBPeriodID and b.KodeID=p.KodeID and LEFT(p.PMBPeriodID, 4)='{$tahun}'", "b.TahunLulus < '{$prevtahun}' and b.KodeID", KodeID, "count(b.PMBID)"); $data = array(array('Fresh Graduate', $fg), array('Non Fresh Graduate', $nfg)); $plot = new PHPlot(800, 600); //$plot->SetImageBorderType('raised'); $plot->SetPlotType('pie'); $plot->SetDataType('text-data-single'); $plot->SetDataValues($data); $plot->SetDataColors(array('red', 'blue', 'green', 'yellow', 'cyan', 'magenta', 'brown', 'lavender', 'pink', 'gray', 'orange')); $plot->setShading(60); $plot->SetLabelScalePosition(0.2); $plot->SetFont('generic', 5); $plot->SetFont('title', 5); $plot->SetFont('legend', 5); $plot->SetTitle("Persentase Calon Mahasiswa Fresh / non Fresh Graduate"); foreach ($data as $row) { $plot->SetLegend(implode(': ', $row)); } $plot->SetIsInline(true); $plot->SetOutputFile($filetujuan); $plot->DrawGraph(); }
function guifi_stats_chart07() { include drupal_get_path('module', 'guifi') . '/contrib/phplot/phplot.php'; $gDirTTFfonts = drupal_get_path('module', 'guifi') . '/contrib/fonts/'; if (isset($_GET['width'])) { $gwidth = $_GET['width']; } else { $gwidth = 500; } if (isset($_GET['height'])) { $gheight = $_GET['height']; } else { $gheight = 450; } $today = getdate(); $year = $today[year]; $month = $today[mon]; $month = $month - 12; $n = 0; $tot = 0; if ($month < 1) { $year = $year - 1; $month = 12 + $month; } $datemin = mktime(0, 0, 0, $month, 1, $year); if (isset($_GET['zone'])) { $zone_id = $_GET['zone']; if ($zone_id == "0") { $zone_id = "0"; } //"3671"; } else { $zone_id = "0"; } $avalue = array(); $adata = array(); for ($i = 0; $i < 10; $i++) { $adata[] = array(0, 0); } $vsql = "select sum(if(timestamp_created >= " . $datemin . ",1,0)) as num, count(*) as total, zone_id\n from {guifi_location}\n where status_flag='Working' "; if ($zone_id != "0") { $achilds = guifi_zone_childs($zone_id); $v = ""; foreach ($achilds as $key => $child) { if ($v == "") { $v .= "zone_id=" . $child; } else { $v .= " or zone_id=" . $child; } } $vsql .= "AND (" . $v . ") "; } $vsql .= "GROUP BY zone_id "; $result = db_query($vsql); while ($record = db_fetch_object($result)) { if ($record->total >= 20) { $vn = $record->num / $record->total * 100; $vmin = 0; for ($i = 1; $i < 10; $i++) { if ($adata[$vmin][1] > $adata[$i][1]) { $vmin = $i; } } if ($vn > $adata[$vmin][1]) { $adata[$vmin][0] = $record->zone_id; $adata[$vmin][1] = $vn; } } } for ($i = 0; $i < 10; $i++) { if ($adata[$i][1] != 0) { $avalue[$adata[$i][0]] = $adata[$i][1]; } } arsort($avalue); foreach ($avalue as $key => $value) { if ($value != 0) { $data[] = array(substr(guifi_get_zone_name($key), 0, 20) . " �", $value); } } $shapes = array('none'); $plot = new PHPlot($gwidth, $gheight); $plot->SetPlotAreaWorld(0, 0, NULL, NULL); $plot->SetFileFormat('png'); $plot->SetDataType("text-data"); $plot->SetDataValues($data); $plot->SetPlotType("bars"); $plot->SetXTickIncrement(1); $plot->SetSkipBottomTick(TRUE); $plot->SetSkipLeftTick(TRUE); $plot->SetTickLength(0); //$plot->SetXTickPos('none'); $plot->SetYDataLabelPos('plotin'); $plot->SetYLabelType('data', 0); $plot->SetTickColor('grey'); $plot->SetTTFPath($gDirTTFfonts); $plot->SetFontTTF('title', 'Vera.ttf', 12); $plot->SetFontTTF('x_label', 'Vera.ttf', 8); if (isset($_GET['title'])) { $plot->SetTitle("guifi.net \n" . t($_GET['title'])); } else { if ($zone_id == "0") { $plot->SetTitle("guifi.net \n" . t('Largest annual increase')); } else { $plot->SetTitle("guifi.net " . t('zone') . ": " . guifi_get_zone_name($zone_id) . "\n" . t('Largest annual increase')); } } //$plot->SetXTitle(t('Zones')); $plot->SetYTitle(t('% increase')); $plot->SetXDataLabelPos('plotdown'); //$plot->SetXLabelAngle(45); $plot->SetXDataLabelAngle(75); $plot->SetGridColor('red'); $plot->SetPlotBorderType('left'); $plot->SetDataColors(array('orange')); $plot->SetTextColor('DimGrey'); $plot->SetTitleColor('DimGrey'); $plot->SetLightGridColor('grey'); $plot->SetBackgroundColor('white'); $plot->SetTransparentColor('white'); $plot->SetIsInline(TRUE); $plot->DrawGraph(); }
function plotfile_me($pdf, $mv_id, $w = 800, $h = 600) { $mvs = new mietvertraege(); $mvs->get_mietvertrag_infos_aktuell($mv_id); $mk = new mietkonto(); $datum_mietdefinition = $mk->datum_1_mietdefinition($mv_id); // echo "<h1>$datum_mietdefinition</h1>"; $a_dat = explode('-', $datum_mietdefinition); $jahr_a = date("Y") - 2; $jahr_e = date("Y") + 3; $jahre = $jahr_e - $jahr_a; $z = 0; for ($jahr = $jahr_a; $jahr <= $jahr_e; $jahr++) { $monat = date("m"); $mk->kaltmiete_monatlich($mv_id, $monat, $jahr); if ($jahr > $jahr_a) { $miete_vorjahr = $arr_stat[$z - 1][1]; $prozent = ($mk->ausgangs_kaltmiete - $miete_vorjahr) / ($miete_vorjahr / 100); } else { $prozent = 0; } $prozent = nummer_punkt2komma($prozent); $arr_stat[$z][0] = "{$jahr}\n{$mk->ausgangs_kaltmiete}\nEUR\n{$prozent} %"; $arr_stat[$z][1] = $mk->ausgangs_kaltmiete; $z++; } // print_r($arr_stat); require_once 'phplot.php'; $plot = new PHPlot($w, $h); $plot->SetImageBorderType('plain'); $plot->SetPlotType('bars'); $plot->SetDataType('text-data'); $plot->SetDataValues($arr_stat); // Main plot title: $plot->SetTitle('MIETENTWICKLUNG' . " {$mvs->einheit_kurzname} \n {$mvs->personen_name_string}"); // No 3-D shading of the bars: $plot->SetShading(0); // Make a legend for the 3 data sets plotted: // $plot->SetLegend(array('Mieteinnahmen', 'Leerstand')); $plot->SetLegend(array('MIETE')); // Turn off X tick labels and ticks because they don't apply here: $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); // Draw it $plot->SetIsInline(true); $img = $plot->DrawGraph(); $px = 'px'; // echo "<hr>$plot->img "; // $plot->PrintImageFrame(); // $hhh = $plot->PrintImage(); $ima = $plot->EncodeImage(); // echo "<a style=\"width:$w$px;heigth:$h$px;\" href=\"?option=stat_mv_big&mv_id=$mv_id\"><img style=\"width:$w$px;heigth:$h$px;\" src=\"$plot->img\"></img></a>"; // die(); // echo "<img src=\"$ima\">"; // die(); if ($mvs->mietvertrag_aktuell == 1) { $pdf->ezNewPage(); $druckdatum = date("d.m.Y"); $pdf->addText(464, 730, 7, "<b>Druckdatum: {$druckdatum}</b>"); $pdf->addPngFromFile($ima, $pdf->x + 10, $pdf->y - $h, $w, $h); } }
prnMsg(_('The sales graph data for the selected criteria could not be retrieved because') . ' - ' . DB_error_msg($db), 'error'); include 'includes/footer.inc'; exit; } if (DB_num_rows($SalesResult) == 0) { prnMsg(_('There is not sales data for the criteria entered to graph'), 'info'); include 'includes/footer.inc'; exit; } $GraphArrays = array(); $i = 0; while ($myrow = DB_fetch_array($SalesResult)) { $GraphArray[$i] = array(MonthAndYearFromSQLDate($myrow['lastdate_in_period']), $myrow['sales'], $myrow['budget']); $i++; } $graph->SetDataValues($GraphArray); $graph->SetDataColors(array('grey', 'wheat'), array('black')); $graph->SetLegend(array(_('Actual'), _('Budget'))); //Draw it $graph->DrawGraph(); echo '<br /><table class="selection" summary="' . _('Sales Report Graph') . '"> <tr> <th>' . _('Sales Report Graph') . ' <img src="' . $RootPath . '/css/' . $Theme . '/images/printer.png" class="PrintIcon noPrint" title="' . _('Print') . '" alt="' . _('Print') . '" onclick="window.print();" /> </th> </tr> <tr> <td> <img src="companies/' . $_SESSION['DatabaseName'] . '/reports/salesgraph.png" alt="' . _('Sales Report Graph') . '"></img> </td> </tr>
} // Read and check the file header. $row = fgetcsv($f); if ($row === FALSE || $row[0] != 'Date' || $row[1] != 'Open' || $row[2] != 'High' || $row[3] != 'Low' || $row[4] != 'Close') { fwrite(STDERR, "Incorrect header in: {$filename}\n"); return FALSE; } // Read the rest of the file and convert. while ($d = fgetcsv($f)) { $data[] = array('', strtotime($d[0]), $d[1], $d[2], $d[3], $d[4]); } fclose($f); return $data; } $plot = new PHPlot(800, 600); $plot->SetImageBorderType('plain'); // Improves presentation in the manual $plot->SetTitle("Candlesticks Financial Plot (data-data)\nMSFT Q1 2009"); $plot->SetDataType('data-data'); $plot->SetDataValues(read_prices_data_data(DATAFILE)); $plot->SetPlotType('candlesticks'); $plot->SetDataColors(array('SlateBlue', 'black', 'SlateBlue', 'black')); $plot->SetXLabelAngle(90); $plot->SetXLabelType('time', '%Y-%m-%d'); $plot->SetXTickIncrement(7 * 24 * 60 * 60); // 1 week interval if (method_exists($plot, 'TuneYAutoRange')) { $plot->TuneYAutoRange(0); } // Suppress Y zero magnet (PHPlot >= 6.0.0) $plot->DrawGraph();
function costo_externo_interno_año($id_oficina, $año) { $this->autoLayout = false; $this->autoRender = false; $this->loadModel('CentroCosto'); $sql_oficina = ''; if ($id_oficina != 0) { $sql_oficina = " AND Cencos_id='" . $id_oficina . "' "; $cenco = $this->CentroCosto->find('first', array('fields' => array('CentroCosto.Cencos_nombre'), 'conditions' => array('CentroCosto.Cencos_id' => $id_oficina))); $subtitulo_oficina = 'la dependencia ' . mb_convert_case($cenco['CentroCosto']['Cencos_nombre'], MB_CASE_TITLE, "UTF-8"); } else { $subtitulo_oficina = 'todas las dependencias'; } $meses = $this->Solicitud->query("SELECT MONTH(solucionada) AS mes FROM solicitudes WHERE estado='s' " . $sql_oficina . " AND YEAR(solucionada)=" . $año . " GROUP BY MONTH(solucionada)"); if (!empty($meses)) { // Inicializamos el arreglo en ceros (para los meses ke no tienen solicitudes). $totales = array(); for ($i = 1; $i <= 12; $i++) { $totales[$i][0][0] = array('costo_i' => 0, 'costo_e' => 0); } foreach ($meses as $mes) { $costos_e_i = $this->Solicitud->query("SELECT SUM(costo_externo) AS costo_e, SUM(costo_interno) AS costo_i FROM solicitudes WHERE estado='s' AND YEAR(solucionada)=" . $año . " AND MONTH(solucionada)=" . $mes[0]['mes']); $totales[$mes[0]['mes']] = $costos_e_i; } if (!empty($totales)) { $total_costo_interno = $total_costo_externo = 0; $i = 0; $arreglo_plot = array(); foreach ($totales as $mes => $arreglo_mes) { // se construye el array para el PHPlot. if (count($arreglo_mes) > 0) { $arreglo_plot[$i] = array($this->meses[$mes], $arreglo_mes[0][0]['costo_i'], $arreglo_mes[0][0]['costo_e']); $total_costo_interno += $arreglo_mes[0][0]['costo_i']; $total_costo_externo += $arreglo_mes[0][0]['costo_e']; } else { $arreglo_plot[$i] = array($this->meses[$mes], 0, 0); } $i++; } $plot = new PHPlot(1790, 500); $plot->SetDataValues($arreglo_plot); $plot->SetDataType('text-data'); // Fuentes $plot->SetUseTTF(true); $plot->SetFontTTF('legend', 'FreeSans.ttf', 9); $plot->SetFontTTF('title', 'FreeSans.ttf', 14); $plot->SetFontTTF('y_label', 'FreeSans.ttf', 9); $plot->SetFontTTF('x_label', 'FreeSans.ttf', 10); $plot->SetFontTTF('y_title', 'FreeSans.ttf', 14); $plot->SetFontTTF('x_title', 'FreeSans.ttf', 12); // Titulos $plot->SetTitle("\nTotal de costos internos/externos\n" . "de " . $subtitulo_oficina . " en el año " . $año . "\n TOTAL Costo Interno = \$" . $total_costo_interno . "\n" . "TOTAL Costo Externo = \$" . $total_costo_externo); $plot->SetYTitle('$ COSTO'); // Etiquetas $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); $plot->SetYTickLabelPos('none'); $plot->SetYTickPos('none'); $plot->SetYDataLabelPos('plotin'); $plot->SetDrawXGrid(true); // Leyenda $leyenda = array('Costo Interno', 'Costo Externo'); $plot->SetLegend($leyenda); $plot->SetLegendPixels(27, 0); $plot->SetDataColors(array('beige', 'YellowGreen')); $plot->SetPlotType('bars'); $plot->SetShading(5); $plot->DrawGraph(); } } }
# From PHPlot forum 2010-12-20 require_once 'phplot.php'; // First data array for OHLC data: Date, Open, High, Low, Close $data1 = array(array('Dec 6', 20, 24, 19, 22), array('Dec 7', 22, 26, 20, 26), array('Dec 8', 26, 28, 22, 24), array('Dec 9', 24, 30, 22, 28), array('Dec 10', 28, 30, 15, 18)); $n_points = count($data1); // Second data array contains two lines, calculated from above. // 1st is opening prices, 2nd is middle of the daily range = (low+high)/2. $data2 = array(); for ($i = 0; $i < $n_points; $i++) { $data2[] = array('', $data1[$i][1], ($data1[$i][2] + $data1[$i][3]) / 2); } $p = new PHPlot(800, 600); $p->SetPrintImage(0); // Do not output image until told // First plot: $p->SetDataValues($data1); $p->SetDataType('text-data'); $p->SetPlotType('ohlc'); $p->SetPlotAreaWorld(NULL, 0); // For Y to start at 0 $p->SetXTickPos('none'); $p->SetTitle('OHLC and Line Plot Overlay'); $p->SetXTitle('Date', 'plotdown'); $p->SetYTitle('Security Price', 'plotleft'); $p->SetDrawPlotAreaBackground(True); $p->SetPlotBgColor('PeachPuff'); $p->SetMarginsPixels(50, 50, 50, 50); $p->DrawGraph(); // Second plot: $p->SetDrawPlotAreaBackground(False); $p->SetDataValues($data2);
# Results in Y axis on left side at X=10, X axis at bottom Y=10 $data1 = array(array('', 10, 10), array('', 11, 11), array('', 12, 12)); # Data array for plot #2: # X axis should in the middle at Y=0 # Y axis should be on left at X=-20 # But instead they stick from plot #1 at Y=10, X=10. $data2 = array(array('', -20, -10), array('', -5, 2), array('', 30, 20)); // Common setup: $plot = new PHPlot(460, 600); $plot->SetTitle("Multiple Plots - axis position (case {$case})\n" . "X and Y axis positions stick from upper plot"); $plot->SetPlotType('points'); $plot->SetDataType('data-data'); $plot->SetPrintImage(False); // Plot #1: $plot->SetPlotAreaPixels(NULL, 60, NULL, 300); $plot->SetPlotAreaWorld(); $plot->SetDataValues($data1); $plot->DrawGraph(); // Plot #2: $plot->SetPlotAreaPixels(NULL, 330, NULL, 570); $plot->SetPlotAreaWorld(); $plot->SetDataValues($data2); if ($case == 2) { $plot->SetXAxisPosition(); // Reset to default $plot->SetYAxisPosition(); // Reset to default } $plot->DrawGraph(); // Finish: $plot->PrintImage();
license@systemsmanager.net so we can mail you a copy immediately. */ include DIR_WS_CLASSES . 'phplot.php'; $year = $_GET['year'] ? $_GET['year'] : date('Y'); $month = $_GET['month'] ? $_GET['month'] : date('n'); $days = date('t', mktime(0, 0, 0, $month)) + 1; $stats = array(); for ($i = 1; $i < $days; $i++) { $stats[] = array($i, '0', '0'); } $banner_stats_query = smn_db_query("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'"); while ($banner_stats = smn_db_fetch_array($banner_stats_query)) { $stats[$banner_stats['banner_day'] - 1] = array($banner_stats['banner_day'], $banner_stats['value'] ? $banner_stats['value'] : '0', $banner_stats['dvalue'] ? $banner_stats['dvalue'] : '0'); } $graph = new PHPlot(600, 350, 'images/graphs/banner_daily-' . $banner_id . '.' . $banner_extension); $graph->SetFileFormat($banner_extension); $graph->SetIsInline(1); $graph->SetPrintImage(0); $graph->SetSkipBottomTick(1); $graph->SetDrawYGrid(1); $graph->SetPrecisionY(0); $graph->SetPlotType('lines'); $graph->SetPlotBorderType('left'); $graph->SetTitleFontSize('4'); $graph->SetTitle(sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner['banners_title'], strftime('%B', mktime(0, 0, 0, $month)), $year)); $graph->SetBackgroundColor('white'); $graph->SetVertTickPosition('plotleft'); $graph->SetDataValues($stats); $graph->SetDataColors(array('blue', 'red'), array('blue', 'red')); $graph->DrawGraph(); $graph->PrintImage();
function plot_guifi() { include drupal_get_path('module', 'guifi') . '/contrib/phplot/phplot.php'; $result = db_query("select COUNT(*) as num, MONTH(FROM_UNIXTIME(timestamp_created)) as mes, YEAR(FROM_UNIXTIME(timestamp_created)) as ano from {guifi_location} where status_flag='Working' GROUP BY YEAR(FROM_UNIXTIME(timestamp_created)),MONTH(FROM_UNIXTIME(timestamp_created)) "); $inicial = 5; $nreg = $inicial; $tot = 0; $ano = 2004; $mes = 5; $items = 2004; $label = ""; while ($record = db_fetch_object($result)) { if ($record->ano >= 2004) { if ($mes == 12) { $mes = 1; $ano++; } else { $mes++; } while ($ano < $record->ano || $mes < $record->mes) { $nreg++; if ($mes == 6) { $label = $ano; } else { $label = ''; } $data[] = array("{$label}", $nreg, $tot, ''); if ($mes == 12) { $mes = 1; $ano++; } else { $mes++; } } $tot += $record->num; $nreg++; if ($mes == 6) { $label = $ano; } else { $label = ''; } $data[] = array("{$label}", $nreg, $tot, ''); } else { $tot += $record->num; } } while ($mes < 12) { $nreg++; $mes++; if ($mes == 6) { $label = $ano; } else { $label = ''; } $data[] = array("{$label}", $nreg, ""); } $items = ($ano - $items + 1) * 12; if ($tot % 1000 < 30) { $data[$nreg - $inicial - 1][3] = $tot; $vt = floor($tot / 1000) * 1000; $vtitle = $vt . " " . t('Nodes') . "!!!"; $tcolor = 'red'; } else { $vtitle = t('Working nodes'); $tcolor = 'DimGrey'; } $shapes = array('none', 'circle'); $plot = new PHPlot(200, 150); $plot->SetPlotAreaWorld(0, 0, $items, NULL); $plot->SetFileFormat('png'); $plot->SetDataType("data-data"); $plot->SetDataValues($data); $plot->SetPlotType("linepoints"); $plot->SetYTickIncrement(2000); $plot->SetXTickIncrement(12); $plot->SetSkipBottomTick(TRUE); $plot->SetSkipLeftTick(TRUE); $plot->SetXAxisPosition(0); $plot->SetPointShapes($shapes); $plot->SetPointSizes(10); $plot->SetTickLength(3); $plot->SetDrawXGrid(TRUE); $plot->SetTickColor('grey'); $plot->SetTitle($vtitle); $plot->SetDrawXDataLabelLines(FALSE); $plot->SetXLabelAngle(0); $plot->SetXLabelType('custom', 'Plot1_LabelFormat'); $plot->SetGridColor('red'); $plot->SetPlotBorderType('left'); $plot->SetDataColors(array('orange')); $plot->SetTextColor('DimGrey'); $plot->SetTitleColor($tcolor); $plot->SetLightGridColor('grey'); $plot->SetBackgroundColor('white'); $plot->SetTransparentColor('white'); $plot->SetXTickLabelPos('none'); $plot->SetXDataLabelPos('plotdown'); $plot->SetIsInline(TRUE); $plot->DrawGraph(); }
# PHPlot Example - Horizontal Error Plot require_once 'phplot.php'; # The experimental results as a series of temperature measurements: $results = array(98, 102, 100, 103, 101, 105, 110, 108, 109); # The accuracy of our measuring equipment is +/- 5% $error_factor = 0.05; # Convert the experimental results to a PHPlot data array for error plots. function reduce_data($results, $error_factor) { # Use the average of measurements to approximate the error amount: $err = $error_factor * array_sum($results) / count($results); # Build the 'data-data-yx-error' data array: $data = array(); $i = 1; foreach ($results as $value) { $data[] = array("Sample {$i}", $i++, $value, $err, $err); } return $data; } $plot = new PHPlot(800, 600); $plot->SetTitle('Experiment Results'); $plot->SetXTitle('Melting Temperature (degrees C)'); $plot->SetDataValues(reduce_data($results, $error_factor)); $plot->SetDataType('data-data-yx-error'); $plot->SetPlotType('points'); $plot->SetYTickPos('none'); $plot->SetImageBorderType('plain'); // Improves presentation in the manual $plot->SetPlotAreaWorld(80); $plot->DrawGraph();
<?php # $Id$ # Testing phplot - data-data ordering require_once 'phplot.php'; # 10 lines, one for each shape: $data = array(array('', 1, 20), array('', 2, 2), array('', 3, 19), array('', 4, 3), array('', 6, 4), array('', 7, 17), array('', 8, 5), array('', 9, 16), array('', 5, 18), array('', 10, 6)); $p = new PHPlot(); $p->SetTitle('Out-of-order data-data points'); $p->SetPlotType('lines'); $p->SetDataType('data-data'); $p->SetDataValues($data); $p->SetPlotAreaWorld(0, 0, 12, 25); $p->SetXTickIncrement(1); $p->SetYTickIncrement(1); # We don't use the data labels (all set to '') so might as well turn them off: $p->SetXDataLabelPos('none'); # Draw both grids: $p->SetDrawXGrid(True); $p->SetDrawYGrid(True); # The default $p->DrawGraph();
// set plot data and colors while ($data = $stat_query->fetch_row()) { $plot_data[] = array($data[0], $data[1]); $data_colors[] = '#' . generateRandomColors(); } break; } /** * Charts data definition end */ // Create plot if ($plot_data && $chart) { // set plot titles $plot->SetTitle($chart_title); // set data $plot->SetDataValues($plot_data); // set plot colors $plot->SetDataColors($data_colors); // set plot shading $plot->SetShading(20); // set plot type to pie $plot->SetPlotType('pie'); $plot->SetDataType('text-data-single'); // set legend foreach ($plot_data as $row) { $plot->SetLegend(implode(': ', $row)); } //Draw it $plot->DrawGraph(); } exit;
<?php # $Id$ # PHPlot test: Box plot, with image map area outlines shown. # This produces a plot image with the areas that would be in an image map # outlined. It does not produce HTML or an image map. require_once 'phplot.php'; $data = array(array('A', 1, 10, 12, 15, 17, 20), array('B', 2, 5, 10, 16, 20, 24, 2, 3, 4), array('C', 3, 12, 13, 14, 15, 16, 20), array('D', 4, 10, 11, 12, 13, 14), array('E', 5, 12, 12, 15, 18, 20), array('F', 6, 12, 14, 16, 18, 18), array('G', 7, 10, 10, 15, 20, 20)); $data_type = 'data-data'; $plot_type = 'boxes'; $title = "PHPlot Test: {$plot_type} plot with image map areas outlined"; # Callback for 'data_points': Outline the area function store_map($im, $passthru, $shape, $row, $col, $x1, $y1, $x2, $y2) { static $color = NULL; if (!isset($color)) { $color = imagecolorallocate($im, 255, 0, 0); } imagesetthickness($im, 3); imagerectangle($im, $x1, $y1, $x2, $y2, $color); imagesetthickness($im, 1); } $plot = new PHPlot(800, 600); $plot->SetTitle($title); $plot->SetImageBorderType('plain'); $plot->SetDataValues($data); $plot->SetDataType($data_type); $plot->SetPlotType($plot_type); $plot->SetPlotAreaWorld(0, 0, 8, 25); $plot->SetCallback('data_points', 'store_map'); $plot->DrawGraph();