示例#1
0
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;
}
示例#2
0
# 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();
示例#3
0
}
# Create a PHPlot object which will make an 800x400 pixel image:
$p = new PHPlot(800, 400);
# Use TrueType fonts:
//$p->SetDefaultTTFont('./arial.ttf');
# Set the main plot title:
$p->SetTitle('PHPlot Customer Satisfaction (estimated)');
# Select the data array representation and store the data:
$p->SetDataType('text-data');
$p->SetDataValues($data);
# Select the plot type - bar chart:
$p->SetPlotType('bars');
# Define the data range. PHPlot can do this automatically, but not as well.
$p->SetPlotAreaWorld(0, 0, 9, 100);
# Select an overall image background color and another color under the plot:
$p->SetBackgroundColor('#ffffcc');
$p->SetDrawPlotAreaBackground(True);
$p->SetPlotBgColor('#ffffff');
# Draw lines on all 4 sides of the plot:
$p->SetPlotBorderType('full');
# Set a 3 line legend, and position it in the upper left corner:
$p->SetLegend(array('Features', 'Bugs', 'Happy Users'));
$p->SetLegendWorld(0.1, 95);
# Turn data labels on, and all ticks and tick labels off:
$p->SetXDataLabelPos('plotdown');
$p->SetXTickPos('none');
$p->SetXTickLabelPos('none');
$p->SetYTickPos('none');
$p->SetYTickLabelPos('none');
# Generate and output the graph now:
$p->DrawGraph();
示例#4
0
//	$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);
$graph->SetXTickPos($which_xtick_pos);
$graph->SetYTickPos($which_ytick_pos);
$graph->SetShading($which_shading);
$graph->SetLineWidth($which_line_width);
$graph->SetErrorBarLineWidth($which_errorbar_line_width);
$graph->SetDrawDashedGrid($which_dashed_grid);
switch ($which_draw_grid) {
    case 'x':
        $graph->SetDrawXGrid(TRUE);
        $graph->SetDrawYGrid(FALSE);
        break;
    case 'y':
        $graph->SetDrawXGrid(FALSE);
        $graph->SetDrawYGrid(TRUE);
        break;
    case 'both':
        $graph->SetDrawXGrid(TRUE);
 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();
         }
     }
 }
示例#6
0
# this script. The parameters are shown in the defaults array below:
if (!isset($tp)) {
    $tp = array();
}
$tp = array_merge(array('title' => 'Tick Count:', 'xmin' => 0, 'xmax' => 98, 'ymin' => 0, 'ymax' => 55, 'xti' => 10, 'yti' => 10), $tp);
require_once 'phplot.php';
# The data points don't matter at all. The range is set with SetPlotAreaWorld.
$data = array(array('', 0, 0), array('', 1, 1));
$p = new PHPlot();
$subtitle = " World: ({$tp['xmin']}, {$tp['ymin']}) :" . " ({$tp['xmax']}, {$tp['ymax']})" . " Tickstep: ({$tp['xti']}, {$tp['yti']})";
$p->SetTitle($tp['title'] . $subtitle);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXDataLabelPos('none');
$p->SetXTitle('X');
$p->SetYTitle('Y');
$p->SetPlotAreaWorld($tp['xmin'], $tp['ymin'], $tp['xmax'], $tp['ymax']);
$p->SetXTickIncrement($tp['xti']);
$p->SetYTickIncrement($tp['yti']);
#$p->SetSkipTopTick(False);
# Draw both grids:
$p->SetDrawXGrid(True);
$p->SetDrawYGrid(True);
# Axes on all sides:
$p->SetXTickPos('both');
$p->SetXTickLabelPos('both');
$p->SetYTickPos('both');
$p->SetYTickLabelPos('both');
$p->SetPlotBorderType('full');
$p->SetPlotType('lines');
$p->DrawGraph();
示例#7
0
function guifi_stats_chart03()
{
    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;
    }
    if (isset($_GET['zone'])) {
        $zone_id = $_GET['zone'];
        if ($zone_id == "3671") {
            $zone_id = "0";
        }
    } else {
        $zone_id = "0";
    }
    $vsql = "select COUNT(*) as num, month(FROM_UNIXTIME(timestamp_created)) as mes\n      from {guifi_location} 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 MONTH(FROM_UNIXTIME(timestamp_created)) ";
    $result = db_query($vsql);
    $tot = 0;
    $valor = 0;
    while ($record = db_fetch_object($result)) {
        $tot += $record->num;
        $data[] = array("{$record->mes}", $record->num);
    }
    foreach ($data as &$dat) {
        $dat[1] = $dat[1] * 100 / $tot;
    }
    $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->SetYTickIncrement(10);
    $plot->SetSkipBottomTick(TRUE);
    $plot->SetSkipLeftTick(TRUE);
    $plot->SetTickLength(0);
    $plot->SetXTickPos('none');
    $plot->SetYTickPos('none');
    $plot->SetDrawYGrid(FALSE);
    $plot->SetYTickLabelPos('none');
    $plot->SetYDataLabelPos('plotin');
    $plot->SetTickColor('grey');
    $plot->SetTTFPath($gDirTTFfonts);
    $plot->SetFontTTF('title', 'Vera.ttf', 12);
    if (isset($_GET['title'])) {
        $plot->SetTitle("guifi.net      \n" . t($_GET['title']));
    } else {
        if ($zone_id == "0") {
            $plot->SetTitle("guifi.net      \n" . t('Monthly average'));
        } else {
            $plot->SetTitle("guifi.net    " . t('zone') . ": " . guifi_get_zone_name($zone_id) . "\n" . t('Monthly average'));
        }
    }
    $plot->SetXTitle(t('Months'));
    $plot->SetYTitle(t('% Working nodes'));
    $plot->SetXDataLabelPos('plotdown');
    $plot->SetXLabelAngle(0);
    $plot->SetYLabelType('data', 2);
    $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();
}
示例#8
0
// First data array for Left axis graph:
$data1 = array(array('', 0, 20), array('', 1, 15), array('', 2, 8), array('', 3, 6), array('', 4, 3), array('', 5, 7), array('', 6, 14), array('', 7, 28), array('', 8, 32), array('', 9, 35));
// Second data array for Right axis graph:
$data2 = array(array('', 0, 17), array('', 1, 22), array('', 2, 30), array('', 3, 36), array('', 4, 49), array('', 5, 57), array('', 6, 67), array('', 7, 73), array('', 8, 78), array('', 9, 81));
$p = new PHPlot(800, 600);
$p->SetPrintImage(0);
// Do not output image until told
// First plot:
$p->SetDataValues($data1);
$p->SetDataType('data-data');
$p->SetPlotType('lines');
$p->SetPlotAreaWorld(NULL, 0, NULL, NULL);
// Force Y to start at 0
$p->SetPlotAreaPixels(60, 40, 740, 560);
// Force same window for both plots
$p->SetYTickPos('plotleft');
// The default
$p->SetYTickLabelPos('plotleft');
// The default
$p->SetXTickIncrement(1);
$p->SetDataColors('blue');
// Force data color
$p->SetTitle('Overlay Line Plots to get Different Y Scales');
$p->SetTitleColor('black');
$p->SetXTitle('X Axis Title');
$p->SetYTitle('Temperature', 'plotleft');
$p->SetYTitleColor('blue');
$p->DrawGraph();
// Second plot:
$p->SetDataValues($data2);
$p->SetDataType('data-data');
示例#9
0
$a = 0.5;
$d_theta = M_PI / 48.0;
for ($theta = M_PI * 7; $theta >= 0; $theta -= $d_theta) {
    $data[] = array('', $a * $theta * cos($theta), $a * $theta * sin($theta));
}
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('points');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Scatterplot (points plot)');
# Need to set area and ticks to get reasonable choices.
$plot->SetPlotAreaWorld(-12, -12, 12, 12);
$plot->SetXTickIncrement(2);
$plot->SetYTickIncrement(2);
# Move axes and ticks to 0,0, but turn off tick labels:
$plot->SetXAxisPosition(0);
# Is default
$plot->SetYAxisPosition(0);
$plot->SetXTickPos('xaxis');
$plot->SetXTickLabelPos('none');
$plot->SetYTickPos('yaxis');
$plot->SetYTickLabelPos('none');
# Turn on 4 sided borders, now that axes are inside:
$plot->SetPlotBorderType('full');
# Draw both grids:
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
# Is default
$plot->DrawGraph();
 function solicitudes_reparacion_por_operario($id_operario, $año)
 {
     $this->loadModel('ReparacionSolicitud');
     $this->loadModel('Funcionario');
     $meses = $this->ReparacionSolicitud->query("SELECT MONTH(archivada) AS mes FROM reparacion_solicitudes WHERE estado='a' AND ejecutada=1 AND YEAR(archivada)=" . $año . " GROUP BY MONTH(archivada)");
     if (!empty($meses)) {
         // Inicializamos el arreglo en ceros (para los meses ke no tienen solicitudes).
         $total = array();
         for ($i = 1; $i <= 12; $i++) {
             $total[$i][0][0] = array('cuenta' => 0);
         }
         foreach ($meses as $mes) {
             $cant_solicitudes = $this->ReparacionSolicitud->query("SELECT COUNT(*) AS cuenta FROM reparacion_solicitudes WHERE id_funcionario=" . $id_operario . " AND estado='a' AND ejecutada=1 AND YEAR(archivada)=" . $año . " AND MONTH(archivada)=" . $mes[0]['mes']);
             $total[$mes[0]['mes']] = $cant_solicitudes;
         }
         if (!empty($total)) {
             $operario = $this->Funcionario->find('first', array('conditions' => array('Funcionario.id' => $id_operario), 'fields' => array('Funcionario.nombre')));
             foreach ($total as $mes => $arreglo_mes) {
                 $arreglo_plot[] = array($this->meses[$mes], $arreglo_mes[0][0]['cuenta']);
             }
             $plot = new PHPlot(890, 450);
             $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', 10);
             $plot->SetFontTTF('x_label', 'FreeSans.ttf', 10);
             $plot->SetFontTTF('y_title', 'FreeSans.ttf', 14);
             // Titulos
             $plot->SetTitle("\nSolicitudes de reparación\natendidas por " . mb_convert_case($operario['Funcionario']['nombre'], MB_CASE_TITLE, "UTF-8"));
             $plot->SetXTitle('AÑO ' . $año);
             $plot->SetYTitle('# SOLICITUDES');
             // Etiquetas
             $plot->SetXTickLabelPos('none');
             $plot->SetXTickPos('none');
             $plot->SetYTickLabelPos('none');
             $plot->SetYTickPos('none');
             $plot->SetYDataLabelPos('plotin');
             $plot->SetDrawXGrid(true);
             // Leyenda
             $leyenda = array('Solicitudes de Reparación');
             $plot->SetLegend($leyenda);
             $plot->SetLegendPixels(703, 0);
             $plot->SetPlotType('bars');
             $plot->SetShading(7);
             $plot->DrawGraph();
         }
     }
 }
示例#11
0
     $graph->SetXLabelAngle($stat['x_label_angle']);
 } else {
     $graph->SetXLabelAngle(0);
 }
 $graph->SetYLabelAngle(0);
 if (!(isset($stat['tick_increment_y']) && $stat['tick_increment_y'])) {
     $stat['tick_increment_y'] = stats__get_y_increment($stat['data']);
 }
 $graph->SetYTickIncrement($stat['tick_increment_y']);
 $graph->SetXTickLabelPos('plotdown');
 // plotup, plotdown, both, xaxis, none
 $graph->SetYTickLabelPos('both');
 // plotleft, plotright, both, yaxis, none
 $graph->SetXTickPos('plotdown');
 // plotup, plotdown, both, xaxis, none
 $graph->SetYTickPos('both');
 // plotleft, plotright, both, yaxis, none
 //Set some data
 if ($stat['reverse_data']) {
     $data = array_reverse($stat['data']);
 } else {
     $data = $stat['data'];
 }
 $graph->SetDataValues($data);
 $graph->SetXTickLabelPos('none');
 $graph->SetXTickPos('none');
 //echo '<pre>';
 //var_dump($stat);
 //echo '</pre>';
 //Draw it
 if (!isset($_REQUEST['debug'])) {
示例#12
0
#                       <=12    13-17   17-28   30-39   40-54    >=55
$data = array(array('Cherry', 1, 1, 2, 2, 4, 3, 3, 4, 3, 5, 5, 6, 6), array('Apple', 2, 1, 9, 2, 7, 3, 4, 4, 7, 5, 3, 6, 7), array('Pear', 3, '', 2, 2, 2, 3, 3, 4, 4, 5, 3, 6, 2), array('Grape', 4, 1, 8, 2, 5, 3, 5, 4, 6, 5, 3, 6, 4), array('Kiwi', 5, '', 0, 2, 3, 3, 4, 4, 4, 5, 5, 6, 2), array('Banana', 6, 1, 5, 2, 4, 3, 6, 4, 3, 5, 3, 6, 4));
$plot = new PHPlot(600, 600);
$plot->SetTitle("Flavor Preference By Age Group");
$plot->SetDataType('data-data-xyz');
$plot->SetDataValues($data);
$plot->SetPlotType('bubbles');
$plot->SetDataColors('yellow');
// Use same color for all data sets
$plot->SetDrawPlotAreaBackground(True);
$plot->SetPlotBgColor('plum');
$plot->SetLightGridColor('red');
// Change grid color to make it visible
$plot->SetImageBorderType('plain');
$plot->SetPlotBorderType('full');
$plot->SetXTickIncrement(1);
// For grid line spacing
$plot->SetYTickIncrement(1);
$plot->SetPlotAreaWorld(0, 0, 6.5, 6.5);
# Establish the handler for the Y label text:
$plot->SetYLabelType('custom', 'get_label', $y_labels);
$plot->SetXTickPos('both');
// Tick marks on both sides
$plot->SetYTickPos('both');
// Tick marks on top and bottom too
$plot->SetXDataLabelPos('both');
// X axis data labels top and bottom
$plot->SetYTickLabelPos('both');
// Y axis labels left and right
$plot->SetDrawXGrid(True);
$plot->DrawGraph();
示例#13
0
文件: tick.php 项目: myfarms/PHPlot
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotAreaWorld(0, 0, 4, 10);
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(1);
$p->SetPlotBorderType('full');
$p->SetXDataLabelPos($tp['xdatalabel']);
$p->SetXTickLabelPos($tp['xticklabel']);
if (isset($tp['xtick'])) {
    $p->SetXTickPos($tp['xtick']);
} else {
    $p->SetXTickPos($tp['xticklabel']);
}
$p->SetYTickLabelPos($tp['yticklabel']);
$p->SetYTickPos($tp['yticklabel']);
$p->SetXTitle('X TITLE');
$p->SetYTitle('Y TITLE');
# Tick skip tests:
if (isset($tp['skiptick'])) {
    $s = $tp['skiptick'];
    $n = strlen($s);
    for ($i = 0; $i < $n; $i++) {
        switch ($s[$i]) {
            case 'T':
                $p->SetSkipTopTick(True);
                break;
            case 'B':
                $p->SetSkipBottomTick(True);
                break;
            case 'L':
示例#14
0
# Specify Y range of these data sets:
$plot->SetPlotAreaWorld(NULL, 0, NULL, 5000);
$plot->SetYTickIncrement(500);
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
# Format Y tick labels as integers, with thousands separator:
$plot->SetYLabelType('data', 0);
$plot->DrawGraph();
# Plot 2
$plot->SetDrawPlotAreaBackground(False);
// Cancel background
$plot->SetDrawYGrid(False);
// Cancel grid, already drawn
$plot->SetPlotType('linepoints');
$plot->SetDataValues($data2);
# Set Y title for plot #2 and position it on the right side:
$plot->SetYTitle($y_title2, 'plotright');
# Set and position legend #2:
$plot->SetLegend($legend2);
$plot->SetLegendPixels(690, 30);
# Specify Y range of this data set:
$plot->SetPlotAreaWorld(NULL, 0, NULL, 50);
$plot->SetYTickIncrement(10);
$plot->SetYTickPos('plotright');
$plot->SetYTickLabelPos('plotright');
$plot->SetDataColors('black');
# Format Y tick labels as integers with trailing percent sign:
$plot->SetYLabelType('data', 0, '', '%');
$plot->DrawGraph();
# Now output the graph with both plots:
$plot->PrintImage();