当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPlot::SetShading方法代码示例

本文整理汇总了PHP中PHPlot::SetShading方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPlot::SetShading方法的具体用法?PHP PHPlot::SetShading怎么用?PHP PHPlot::SetShading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPlot的用法示例。


在下文中一共展示了PHPlot::SetShading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testBars

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();
}
开发者ID:SuichiesS,项目名称:homewatch,代码行数:21,代码来源:phplotbars.php

示例2: array

 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();
         }
     }
 }
开发者ID:hongo-de-yuggoth,项目名称:SIMAU,代码行数:71,代码来源:reportes_estadisticos_controller.php

示例3: elseif

 $graph->SetXTitle(_('Month'));
 if ($_POST['GraphValue'] == 'Net') {
     $graph->SetYTitle(_('Sales Value'));
 } elseif ($_POST['GraphValue'] == 'GP') {
     $graph->SetYTitle(_('Gross Profit'));
 } else {
     $graph->SetYTitle(_('Quantity'));
 }
 $graph->SetXTickPos('none');
 $graph->SetXTickLabelPos('none');
 $graph->SetBackgroundColor('white');
 $graph->SetTitleColor('blue');
 $graph->SetFileFormat('png');
 $graph->SetPlotType($_POST['GraphType']);
 $graph->SetIsInline('1');
 $graph->SetShading(5);
 $graph->SetDrawYGrid(TRUE);
 $graph->SetDataType('text-data');
 $SalesResult = DB_query($SQL, $db);
 if (DB_error_no($db) != 0) {
     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;
开发者ID:rrsc,项目名称:KwaMoja,代码行数:31,代码来源:SalesGraph.php

示例4: PHPlot

}
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('stackedbars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
if ($tp['compat']) {
    # backward compatible mode
    $plot->SetTitle('Candy Sales by Month and Product');
    $plot->SetYTitle('Millions of Units');
    $plot->SetLegend(array('Chocolates', 'Mints', 'Hard Candy', 'Sugar-Free'));
} else {
    $plot->SetTitle($tp['title'] . $tp['suffix']);
    $plot->SetXTitle('Month');
    $plot->SetYTitle('Number of Units');
}
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
if (isset($tp['shading'])) {
    $plot->SetShading($tp['shading']);
}
if (isset($tp['xaxispos'])) {
    $plot->SetXAxisPosition($tp['xaxispos']);
}
if (isset($tp['ydatalabel'])) {
    $plot->SetYDataLabelPos($tp['ydatalabel']);
}
if (isset($tp['custom'])) {
    call_user_func($tp['custom'], $plot);
}
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:stackedbars.php

示例5: bcond

function bcond($name, $var)
{
    return $name . ": " . ($var ? "True" : "False") . "\n";
}
$data = array(array('A', 10, 20, 30, 40, 50, 60, 70, 80, 90, 100), array('B', 10, 20, 30, 40, 50, 60, 70, 80, 90, 100), array('C', 10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
$n_cols = count($data[0]) - 1;
for ($i = 0; $i < $n_cols; $i++) {
    $legend[$i] = "== Row {$i} ==";
}
$title = "Legend Colorbox Borders Control\n" . cond("Color box borders: ", $tp['colorboxborders']) . cond("Color box width factor: ", $tp['colorboxwidth']) . bcond("Set Data Border Colors", $tp['setdbcolors']) . bcond("Set Text Color", $tp['settextcolor']);
$p = new PHPlot(800, 600);
$p->SetTitle($title);
$p->SetDataType('text-data');
$p->SetDataValues($data);
$p->SetPlotType('bars');
$p->SetShading(0);
// Unshaded so borders can be seen
$p->SetLegend($legend);
$p->SetLegendPosition(0, 0, 'plot', 0, 0, 5, 5);
if (isset($tp['colorboxborders'])) {
    $p->SetLegendColorboxBorders($tp['colorboxborders']);
}
if (isset($tp['colorboxwidth'])) {
    $p->legend_colorbox_width = $tp['colorboxwidth'];
}
if ($tp['setdbcolors']) {
    $p->SetDataBorderColors(array('red', 'green', 'blue'));
}
if ($tp['settextcolor']) {
    $p->SetTextColor('blue');
}
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legendcolorboxborder.php

示例6: sum

<?php

require '../phplot/phplot.php';
include_once '../conecta_banco.php';
include_once '../funcoes_banco.php';
include_once '../funcoes_auxiliares.php';
$sql = "SELECT cardapio.nome_produto, sum(cardapio_comanda.quantidade) as somatorio\n            FROM cardapio_comanda\n            INNER JOIN cardapio\n                ON cardapio_comanda.id_cardapio = cardapio.id_produto\n            GROUP BY id_cardapio";
$res = mysql_query($sql);
// nome_produto, id_cardapio, somatorio
$resultArr = resultadosParaArray($res);
$plot = new PHPlot();
$data = $resultArr;
$plot->SetDataValues($data);
$plot->SetDataType('text-data');
// legenda texto-numero
$plot->SetPlotType('bars');
// barras
$plot->SetTitle("Produtos Consumidos");
$plot->SetXTitle('Produtos');
$plot->SetYTitle('Quantidade');
$plot->SetYDataLabelPos('plotin');
// imprime o valor acima do grafico
$plot->SetShading(1);
// deixa os graficos 2d
$plot->SetXTickPos('none');
// retira os ticks na linha x
$plot->SetYTickIncrement(1);
// define o incremento de 1 em 1
header("Content-type: image/png");
$plot->DrawGraph();
开发者ID:resmall,项目名称:botecao,代码行数:30,代码来源:produtos_mais_vendidos.php

示例7: array

        $row = array("={$grp}=");
        for ($bar = 1; $bar <= $tp['nbars']; $bar++) {
            $row[] = floor($x + 0.5);
            $tx = $x * $cdt - $y * $sdt;
            $y = $x * $sdt + $y * $cdt;
            $x = $tx;
        }
        $data[] = $row;
    }
}
$p = new PHPlot(800, 600);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('text-data');
$p->SetDataValues($data);
# Options:
#  Note: <=5.0rc3 used x_label font. This was corrected.
if (isset($tp['fontsize'])) {
    $p->SetFont('y_label', $tp['fontsize']);
}
if (isset($tp['shading'])) {
    $p->SetShading($tp['shading']);
}
# Note: This didn't work <= 5.0rc3
if (isset($tp['yprec'])) {
    $p->SetPrecisionY($tp['yprec']);
}
$p->SetXTickLabelPos('none');
$p->SetXTickPos('none');
$p->SetYDataLabelPos('plotin');
$p->SetPlotType('bars');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:bars-datalabel.php

示例8: mietvertraege

 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);
     }
 }
开发者ID:BerlusGmbH,项目名称:Berlussimo,代码行数:62,代码来源:class_stammdaten.php

示例9: array

# PHPlot Example - Horizontal Bars
require_once 'phplot.php';
$data = array(array('San Francisco CA', 20.11), array('Reno NV', 7.5), array('Phoenix AZ', 8.300000000000001), array('New York NY', 49.7), array('New Orleans LA', 64.2), array('Miami FL', 52.3), array('Los Angeles CA', 13.2), array('Honolulu HI', 18.3), array('Helena MT', 11.3), array('Duluth MN', 31.0), array('Dodge City KS', 22.4), array('Denver CO', 15.8), array('Burlington VT', 36.1), array('Boston MA', 42.5), array('Barrow AL', 4.2));
$plot = new PHPlot(800, 800);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle("Average Annual Precipitation (inches)\n" . "Selected U.S. Cities");
$plot->SetBackgroundColor('gray');
#  Set a tiled background image:
$plot->SetPlotAreaBgImage('images/drop.png', 'centeredtile');
#  Force the X axis range to start at 0:
$plot->SetPlotAreaWorld(0);
#  No ticks along Y axis, just bar labels:
$plot->SetYTickPos('none');
#  No ticks along X axis:
$plot->SetXTickPos('none');
#  No X axis labels. The data values labels are sufficient.
$plot->SetXTickLabelPos('none');
#  Turn on the data value labels:
$plot->SetXDataLabelPos('plotin');
#  No grid lines are needed:
$plot->SetDrawXGrid(FALSE);
#  Set the bar fill color:
$plot->SetDataColors('salmon');
#  Use less 3D shading on the bars:
$plot->SetShading(2);
$plot->SetDataValues($data);
$plot->SetDataType('text-data-yx');
$plot->SetPlotType('bars');
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:30,代码来源:horizbar.php

示例10: MONTH

 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();
         }
     }
 }
开发者ID:hongo-de-yuggoth,项目名称:smuq-plaf,代码行数:51,代码来源:reportes_estadisticos_controller.php

示例11: foreach

 foreach ($plot_defaults as $key => $value) {
     if (!isset($stat[$key])) {
         $stat[$key] = $value;
     }
 }
 //Define the object
 $graph = new PHPlot($stat['xsize'], $stat['ysize']);
 $graph->SetDataType($stat['data_type']);
 $graph->SetFileFormat($stat['file_format']);
 $graph->SetPlotType($stat['graphtype']);
 $graph->SetDefaultTTFont('../tagsets/fonts/FreeSerif.ttf');
 $graph->SetPlotBorderType('none');
 // plotleft, plotright, both, full, none
 $graph->SetBackgroundColor($stat['background_color']);
 if ($stat['graphtype'] == 'bars') {
     $graph->SetShading(0);
     $graph->SetPlotAreaWorld(NULL, 0);
 }
 if (count($stat['legend']) > 0) {
     foreach ($stat['legend'] as $key => $val) {
         if (strlen($val) > 23) {
             $stat['legend'][$key] = substr($val, 0, 20) . '...';
         }
     }
     $graph->SetLegend($stat['legend']);
 }
 if ($stat['legend_x'] && $stat['legend_y']) {
     $graph->SetLegendPixels($stat['legend_x'], $stat['legend_y']);
 }
 if ($stat['graphtype'] == 'pie') {
     $graph->SetPlotAreaPixels(150, 0, $stat['xsize'], $stat['ysize']);
开发者ID:danorama,项目名称:orsee,代码行数:31,代码来源:statistics_graph.php

示例12: array

$cumulateddata = array();
$statCounts = $stats->getCount();
$max = 1;
foreach ($statCounts as $statCount) {
    $bardata[] = array(date('M', mktime(0, 0, 0, $statCount['m'], 1, 2010)) . "\n" . $statCount['count'], $statCount['count']);
    if ($statCount['count'] > $max) {
        $max = $statCount['count'];
    }
}
$title = $I18N->Msg('a587_stats_general_timestats', 6);
if (rex_lang_is_utf8()) {
    $title = utf8_decode($title);
}
$plot = new PHPlot(350, 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(6);
$plot->DrawGraph();
开发者ID:olien,项目名称:rexsearch,代码行数:31,代码来源:general_timestats.inc.php

示例13: PHPlot

} else {
    $c = 'default';
}
if (isset($grid_color)) {
    $g = $grid_color;
} else {
    $g = 'default';
}
if (isset($shading)) {
    $shade = "Shading: {$shading}";
} else {
    $shade = "Unshaded";
}
$title = "Test Pie Border Control, {$shade}\n" . "Border: {$b}, Border color: {$c}, Grid color: {$g}";
$plot = new PHPlot(800, 600);
$plot->SetTitle($title);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('pie');
$plot->SetDataType('text-data-single');
$plot->SetDataValues($data);
$plot->SetShading(isset($shading) ? $shading : 0);
if (isset($border_color)) {
    $plot->SetPieBorderColor($border_color);
}
if (isset($border_on)) {
    $plot->SetDrawPieBorders($border_on);
}
if (isset($grid_color)) {
    $plot->SetGridColor($grid_color);
}
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:piebcol.php

示例14: array

$tp = array_merge(array('title' => 'Bar Chart - Check Label Centering', 'suffix' => "", 'ND' => 4, 'NB' => 1, 'FSize' => 4, 'Shade' => 0), $tp);
require_once 'phplot.php';
# All the labels are A so we can look for centering.
$data = array();
for ($i = 1; $i <= $tp['ND']; $i++) {
    $row = array('A');
    for ($j = 1; $j <= $tp['NB']; $j++) {
        $row[] = $i + $j;
    }
    $data[] = $row;
}
$plot = new PHPlot(800, 600);
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle($tp['title'] . $tp['suffix']);
# Turn off X tick labels and ticks because they don't apply here:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
# Make the text font bigger for the labels:
$plot->SetFont('x_label', $tp['FSize']);
# Results may differ with or without shading:
if (isset($tp['Shade'])) {
    $plot->SetShading($tp['Shade']);
}
# TESTING:
#$plot->group_frac_width=1.0;
#$plot->bar_width_adjust=0.5;
$plot->DrawGraph();
#fwrite(STDERR, print_r($plot, True));
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:bars-center-label.php

示例15: array

<?php

# $Id$
# PHPlot test: single row stacked bars should look like regular bars?
require_once 'phplot.php';
$data = array(array('Jan', 40), array('Feb', 90), array('Mar', 50), array('Apr', 40), array('May', 75), array('Jun', 45), array('Jul', 40), array('Aug', 35), array('Sep', 50), array('Oct', 45), array('Nov', 35), array('Dec', 40));
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('stackedbars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
$plot->SetTitle("Single-dataset stackedbars\nCompare to unstacked");
$plot->SetShading(0);
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
# Testing:
#$plot->group_frac_width = 1.0;
#$plot->bar_width_adjust=0.5;
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:19,代码来源:bars-stacked.php


注:本文中的PHPlot::SetShading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。