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


PHP BarPlot::SetColor方法代码示例

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


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

示例1: array

 function conf__grafico(toba_ei_grafico $grafico)
 {
     if (isset($this->datos)) {
         $datos = array();
         $leyendas = array();
         foreach ($this->datos as $value) {
             $datos[] = $value['resultado'];
             $leyendas[] = $value['codc_uacad'];
         }
     }
     require_once toba_dir() . '/php/3ros/jpgraph/jpgraph.php';
     require_once toba_dir() . '/php/3ros/jpgraph/jpgraph_bar.php';
     // Setup a basic graph context with some generous margins to be able
     // to fit the legend
     $canvas = new Graph(900, 300);
     $canvas->SetMargin(100, 140, 60, 40);
     $canvas->title->Set('Cr�dito Disponible');
     //$canvas->title->SetFont(FF_ARIAL,FS_BOLD,14);
     // For contour plots it is custom to use a box style ofr the axis
     $canvas->legend->SetPos(0.05, 0.5, 'right', 'center');
     $canvas->SetScale('intint');
     //$canvas->SetAxisStyle(AXSTYLE_BOXOUT);
     //$canvas->xgrid->Show();
     $canvas->ygrid->Show();
     $canvas->xaxis->SetTickLabels($leyendas);
     // A simple contour plot with default arguments (e.g. 10 isobar lines)
     $cp = new BarPlot($datos);
     $cp->SetColor("#B0C4DE");
     $cp->SetFillColor("#B0C4DE");
     $cp->SetLegend("Resultado");
     $canvas->Add($cp);
     // Con esta llamada informamos al gr�fico cu�l es el gr�fico que se tiene
     // que dibujar
     $grafico->conf()->canvas__set($canvas);
 }
开发者ID:pkogan,项目名称:presupuesto,代码行数:35,代码来源:ci_comparacion_unidad.php

示例2: draw_graph

function draw_graph($xarr, $arr)
{
    require_once "jpgraph/jpgraph.php";
    require_once "jpgraph/jpgraph_line.php";
    require_once "jpgraph/jpgraph_bar.php";
    require_once "jpgraph/jpgraph_log.php";
    // Create the graph. These two calls are always required
    $graph = new Graph(350, 250, "auto");
    //$graph->SetScale("lin");
    //$graph->SetScale("textlin");
    $graph->SetScale("loglin");
    // Create the linear plot
    $lineplot = new BarPlot($arr, $xarr);
    $lineplot->SetColor("blue");
    // Add the plot to the graph
    $graph->Add($lineplot);
    // Display the graph
    $graph->Stroke();
}
开发者ID:Turante,项目名称:boincweb,代码行数:19,代码来源:user_graph.php

示例3: array

 function grafico_barra()
 {
     $data1y = array(47, 80, 40, 116);
     $data2y = array(61, 30, 82, 105);
     $data3y = array(115, 50, 70, 93);
     // Create the graph. These two calls are always required
     $graph = new Graph(350, 200, 'auto');
     $graph->SetScale("textlin");
     $theme_class = new UniversalTheme();
     $graph->SetTheme($theme_class);
     $graph->yaxis->SetTickPositions(array(0, 30, 60, 90, 120, 150), array(15, 45, 75, 105, 135));
     $graph->SetBox(false);
     $graph->ygrid->SetFill(false);
     $graph->xaxis->SetTickLabels(array('A', 'B', 'C', 'D'));
     $graph->yaxis->HideLine(false);
     $graph->yaxis->HideTicks(false, false);
     // Create the bar plots
     $b1plot = new BarPlot($data1y);
     $b2plot = new BarPlot($data2y);
     $b3plot = new BarPlot($data3y);
     // Create the grouped bar plot
     $gbplot = new GroupBarPlot(array($b1plot, $b2plot, $b3plot));
     // ...and add it to the graPH
     $graph->Add($gbplot);
     $b1plot->SetColor("white");
     $b1plot->SetFillColor("#cc1111");
     $b2plot->SetColor("white");
     $b2plot->SetFillColor("#11cccc");
     $b3plot->SetColor("white");
     $b3plot->SetFillColor("#1111cc");
     $graph->title->Set("Bar Plots");
     // Display the graph
     $graph_temp_directory = 'temp';
     // in the webroot (add directory to .htaccess exclude)
     $graph_file_name = 'test.png';
     $graph_file_location = $graph_temp_directory . '/' . $graph_file_name;
     $graph->Stroke($graph_file_location);
     // create the graph and write to file
     $data['graph'] = $graph_file_location;
     $this->load->view('supervisor/prueba', $data);
 }
开发者ID:kpeet,项目名称:Brotec_system_repo,代码行数:41,代码来源:graficos.php

示例4: Graph

// Setup the bar graph
//----------------------
$graph2 = new Graph($w, 110);
$graph2->SetScale('linlin', 0, 0, $xmin, $xmax);
$graph2->SetMargin($lm, $rm, 5, 10);
$graph2->SetMarginColor('white');
$graph2->SetFrame(false);
$graph2->SetBox(true);
$graph2->xgrid->Show();
$graph2->xaxis->SetTickPositions($tickPositions, $minTickPositions);
$graph2->xaxis->SetLabelFormatString('My', true);
$graph2->xaxis->SetPos('max');
$graph2->xaxis->HideLabels();
$graph2->xaxis->SetTickSide(SIDE_DOWN);
$b1 = new BarPlot($datay2, $datax);
$b1->SetFillColor('teal');
$b1->SetColor('teal:1.2');
$graph2->Add($b1);
//-----------------------
// Create a multigraph
//----------------------
$mgraph = new MGraph();
$mgraph->SetMargin(2, 2, 2, 2);
$mgraph->SetFrame(true, 'darkgray', 2);
$mgraph->Add($graph);
$mgraph->Add($graph2, 0, 240);
$mgraph->Stroke();
?>


开发者ID:Ethennoob,项目名称:Web,代码行数:28,代码来源:combgraphex1.php

示例5: array

<?php

include "inc/jpgraph.php";
include "inc/jpgraph_bar.php";
include "inc/jpgraph_pie.php";
$ydata = array(11, 20, 8, 12, 5, 1, 9, 13, 5, 7);
$graph = new Graph(350, 250, "auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40, 20, 20, 40);
$graph->title->Set("Empleados");
$graph->xaxis->title->Set("Mes");
$graph->yaxis->title->Set("Dinero");
$barplot = new BarPlot($ydata);
$barplot->SetColor("orange");
$graph->Add($barplot);
$graph->Stroke();
// Se define el array de valores y el array de la leyenda
$datos = array(40, 60, 21, 33);
$leyenda = array("Morenas", "Rubias", "Pelirrojas", "Otras");
//Se define el grafico
$grafico = new PieGraph(450, 300);
//Definimos el titulo
$grafico->title->Set("Mi primer grafico de tarta");
$grafico->title->SetFont(FF_FONT1, FS_BOLD);
//Añadimos el titulo y la leyenda
$p1 = new PiePlot($datos);
$p1->SetLegends($leyenda);
$p1->SetCenter(0.4);
//Se muestra el grafico
$grafico->Add($p1);
$grafico->Stroke();
开发者ID:Kenovix,项目名称:san-miguel,代码行数:31,代码来源:graficos.php

示例6: generateGraphbarrev

 public function generateGraphbarrev($type)
 {
     // $type= "year";
     if ($type == "year") {
         $start = date("Y-");
         $start .= "01-01 00-00-00";
         $end = date("Y-");
         $end .= "12-31 23-59-59";
     } elseif ($type == "month") {
         $start = date("Y-m-");
         $start .= "01 00-00-00";
         $end = date("Y-m-");
         $end .= "31 23-59-59";
     } elseif ($type == "day") {
         $start = date("Y-m-d");
         $start .= " 00-00-00";
         $end = date("Y-m-d");
         $end .= " 23-59-59";
     } elseif ($type == "week") {
         $date = date("Y-m-d");
     }
     //$this->load->database();
     if ($type == "week") {
         $sql = DB::select(DB::raw("SELECT `id` FROM `sales` WHERE YEARWEEK(`created_at`) = YEARWEEK('{$date}') AND `deleted` = '0' "));
     } else {
         $sql = DB::select(DB::raw("SELECT `id` FROM `sales` WHERE (`created_at` BETWEEN '{$start}' AND '{$end}') AND `deleted` = '0' "));
     }
     foreach ($sql as $row) {
         $sales_id[] = $row->id;
     }
     if (!isset($sales_id)) {
         $sales_id[] = 0;
         $sales_id[] = 0;
     }
     $ids = join(',', $sales_id);
     //$sql = "SELECT COUNT(sales_product.id) AS 'Count', item.name AS 'Name' FROM sales_product INNER JOIN item ON item.id = sales_product.product WHERE sales_product.sale_id IN ($ids) GROUP BY sales_product.product ORDER BY `Count` DESC";
     $sql = DB::select(DB::raw("SELECT COUNT(sales_product.id) AS 'Count', item.name AS 'Name' FROM sales_product INNER JOIN item ON item.id = sales_product.product WHERE sales_product.sale_id IN ({$ids}) GROUP BY sales_product.product ORDER BY `Count` DESC"));
     foreach ($sql as $row) {
         $inq[] = $row->Count;
         $leg[] = $row->Name;
     }
     if (!isset($inq)) {
         $inq[] = 0;
         $leg[] = "null";
     }
     if (sizeof($inq) > 5) {
         $c = sizeof($inq) - 1;
         $other = 0;
         for ($x = 4; $x <= $c; $x++) {
             $other = $other + $inq[$x];
             unset($inq[$x]);
             unset($leg[$x]);
         }
         $inq[4] = $other;
         $leg[4] = "other";
     }
     $data1y = $inq;
     echo public_path('plugins\\streaming\\protected\\start.php');
     echo asset('asxcasx\\dsddsd');
     //        die();
     // Create the graph. These two calls are always required
     $graph = new \Graph(350, 250, 'auto');
     $graph->SetScale("textlin");
     $theme_class = new \UniversalTheme();
     $graph->SetTheme($theme_class);
     // $graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135));
     $graph->SetBox(false);
     $graph->ygrid->SetFill(false);
     $graph->xaxis->SetTickLabels($leg);
     $graph->xaxis->title->Set('Products');
     $graph->yaxis->HideLine(false);
     $graph->yaxis->HideTicks(false, false);
     $graph->yaxis->title->Set('Sales');
     // Create the bar plots
     $b1plot = new \BarPlot($data1y);
     // $b2plot = new BarPlot($data2y);
     // $b3plot = new BarPlot($data3y);
     // Create the grouped bar plot
     // $gbplot = new GroupBarPlot(array($b1plot,$b2plot,$b3plot));
     $gbplot = new \GroupBarPlot(array($b1plot));
     // ...and add it to the graPH
     $graph->Add($gbplot);
     $b1plot->SetColor("white");
     $b1plot->SetFillColor("#6EDBFF");
     $b1plot->SetWidth(45);
     $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
     $fileName = "assets/tmp/" . $type . "_bar_rev.png";
     $graph->img->Stream($fileName);
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:89,代码来源:Bar_revenue.php

示例7: array

$graph->xaxis->SetPosAbsDelta(15);
$graph->yaxis->SetPosAbsDelta(-15);
$graph->xaxis->SetLabelAngle(50);
// Legend
$graph->legend->SetMarkAbsSize(5);
$graph->legend->SetFont(FF_ARIAL, FS_NORMAL, 7);
$graph->legend->Pos(0.02, 0.02, "right", "top");
// Create the bar pot
$colors = array("#aa5500", "#55aa00", "#0055aa", "#aa0055", "#5500aa", "#00aa55", "#ff0000", "#00ff00", "#0000ff", "#ffff00", "#ff00ff", "#00ffff");
$listPlots = array();
foreach ($opbysalle as $key => $value) {
    $bplot = new BarPlot($value["sejour"]);
    $from = $colors[$key];
    $to = "#EEEEEE";
    $bplot->SetFillGradient($from, $to, GRAD_LEFT_REFLECTION);
    $bplot->SetColor("white");
    $bplot->setLegend($value["nom"]);
    $bplot->value->SetFormat("%01.0f");
    $bplot->value->SetColor($colors[$key]);
    $bplot->value->SetFont(FF_ARIAL, FS_NORMAL, 8);
    //$bplot->value->show();
    $listPlots[] = $bplot;
}
$gbplot = new AccBarPlot($listPlots);
$gbplot->SetWidth(0.6);
$gbplot->value->SetFormat("%01.0f");
$gbplot->value->show();
// Set color for the frame of each bar
$graph->Add($gbplot);
// Finally send the graph to the browser
$graph->Stroke();
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:graph_admissions.php

示例8: LinePlot

    $line1 = new LinePlot($data_total_size);
    if ($is_MCP_enabled === true) {
        $abar1 = new AccBarPlot(array($bar2, $bar3, $bar4));
    } else {
        $abar1 = new AccBarPlot(array($bar2, $bar3));
    }
    $gbplot = new GroupBarPlot(array($bar1, $abar1));
    $graph->Add($gbplot);
    $graph->AddY2($line1);
    $bar1->SetColor('blue');
    $bar1->SetFillColor('blue');
    $bar1->SetLegend('Mail');
    $bar2->SetColor('orange');
    $bar2->SetFillColor('orange');
    $bar2->SetLegend('Viruses');
    $bar3->SetColor('red');
    $bar3->SetFillColor('red');
    $bar3->SetLegend('Spam');
    if ($is_MCP_enabled === true) {
        $bar4->SetFillColor('lightblue');
        $bar4->SetLegend('MCP');
    }
    $line1->SetColor('lightgreen');
    $line1->SetFillColor('lightgreen');
    $line1->SetLegend('Volume (' . $size_info['shortdesc'] . ')');
    $line1->SetCenter();
    $graph->Stroke($filename);
}
// HTML Code to display the graph
echo "<TABLE BORDER=\"0\" CELLPADDING=\"10\" CELLSPACING=\"0\" WIDTH=\"100%\">\n";
echo " <TR><TD ALIGN=\"CENTER\"><IMG SRC=\"" . IMAGES_DIR . "mailscannerlogo.gif\" ALT=\"MailScanner Logo\"></TD></TR>";
开发者ID:TBits,项目名称:1.2.0,代码行数:31,代码来源:rep_total_mail_by_date.php

示例9: _renderPlotBar

 private function _renderPlotBar($groupID, $dimensions = '2d')
 {
     $rotation = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
     //	Rotate for bar rather than column chart
     if ($groupID == 0 && $rotation == 'bar') {
         $this->_graph->Set90AndMargin();
     }
     $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
     $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
     if ($labelCount > 0) {
         $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
         $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation);
         //	Rotate for bar rather than column chart
         if ($rotation == 'bar') {
             $datasetLabels = array_reverse($datasetLabels);
             $this->_graph->yaxis->SetPos('max');
             $this->_graph->yaxis->SetLabelAlign('center', 'top');
             $this->_graph->yaxis->SetLabelSide(SIDE_RIGHT);
         }
         $this->_graph->xaxis->SetTickLabels($datasetLabels);
     }
     $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
     $seriesPlots = array();
     if ($grouping == 'percentStacked') {
         $sumValues = $this->_percentageSumCalculation($groupID, $seriesCount);
     }
     //	Loop through each data series in turn
     for ($j = 0; $j < $seriesCount; ++$j) {
         $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
         if ($grouping == 'percentStacked') {
             $dataValues = $this->_percentageAdjustValues($dataValues, $sumValues);
         }
         //	Fill in any missing values in the $dataValues array
         $testCurrentIndex = 0;
         foreach ($dataValues as $k => $dataValue) {
             while ($k != $testCurrentIndex) {
                 $dataValues[$testCurrentIndex] = null;
                 ++$testCurrentIndex;
             }
             ++$testCurrentIndex;
         }
         //	Reverse the $dataValues order for bar rather than column chart
         if ($rotation == 'bar') {
             $dataValues = array_reverse($dataValues);
         }
         $seriesPlot = new BarPlot($dataValues);
         $seriesPlot->SetColor('black');
         $seriesPlot->SetFillColor(self::$_colourSet[self::$_plotColour++]);
         if ($dimensions == '3d') {
             $seriesPlot->SetShadow();
         }
         if (!$this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) {
             $dataLabel = '';
         } else {
             $dataLabel = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue();
         }
         $seriesPlot->SetLegend($dataLabel);
         $seriesPlots[] = $seriesPlot;
     }
     //	Reverse the plot order for bar rather than column chart
     if ($rotation == 'bar' && !($grouping == 'percentStacked')) {
         $seriesPlots = array_reverse($seriesPlots);
     }
     if ($grouping == 'clustered') {
         $groupPlot = new GroupBarPlot($seriesPlots);
     } elseif ($grouping == 'standard') {
         $groupPlot = new GroupBarPlot($seriesPlots);
     } else {
         $groupPlot = new AccBarPlot($seriesPlots);
         if ($dimensions == '3d') {
             $groupPlot->SetShadow();
         }
     }
     $this->_graph->Add($groupPlot);
 }
开发者ID:s-kalaus,项目名称:ekernel,代码行数:75,代码来源:jpgraph.php

示例10: getBarPlot

 function getBarPlot($data, $color)
 {
     $b = new BarPlot($data);
     //parameters hard coded for the moment
     $b->SetAbsWidth(10);
     $b->value->Show(true);
     $b->value->SetColor($this->graph->getMainColor());
     $b->value->SetFormat("%d");
     $b->value->HideZero();
     $b->value->SetMargin(4);
     $b->value->SetFont($this->graph->getFont(), FS_NORMAL, 7);
     $b->SetWidth(0.4);
     $b->SetColor($color . ':0.7');
     $b->SetFillColor($color);
     // end hard coded parameter
     return $b;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:GraphOnTrackers_Engine_Bar.class.php

示例11: BarPlot

$graph->xaxis->SetColor('darkblue', 'black');
// Setup "hidden" y-axis by given it the same color
// as the background (this could also be done by setting the weight
// to zero)
$graph->yaxis->SetColor('lightblue', 'darkblue');
$graph->ygrid->SetColor('white');
// Setup graph title ands fonts
$graph->title->Set('Using grace = 50%');
$graph->title->SetFont(FF_FONT2, FS_BOLD);
$graph->xaxis->SetTitle('Year 2002', 'center');
$graph->xaxis->SetTitleMargin(10);
$graph->xaxis->title->SetFont(FF_FONT2, FS_BOLD);
// Add some grace to the top so that the scale doesn't
// end exactly at the max value.
$graph->yaxis->scale->SetGrace(50);
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor('darkblue');
$bplot->SetColor('darkblue');
$bplot->SetWidth(0.5);
$bplot->SetShadow('darkgray');
// Setup the values that are displayed on top of each bar
// Must use TTF fonts if we want text at an arbitrary angle
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL, FS_NORMAL, 8);
$bplot->value->SetFormat('$%d');
$bplot->value->SetColor('darkred');
$bplot->value->SetAngle(45);
$graph->Add($bplot);
// Finally stroke the graph
$graph->Stroke();
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:grace_ex2.php

示例12: Graph

$color = "navy";
$color2 = "navy";
//$color2 = "lightsteelblue";
// Setup graph
$graph = new Graph($width, 250, "auto");
$graph->SetScale("textlin");
$graph->SetMarginColor($background);
$graph->img->SetMargin(40, 30, 20, 40);
//$graph->SetShadow();
//Setup Frame
$graph->SetFrame(true, "#ffffff");
// Setup graph title
$graph->title->Set($title);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
//$bplot->SetFillGradient($color, $color2, GRAD_MIDVER);
//$bplot->SetColor($color);
// color@transparencia
$bplot->SetFillColor(array(COLOR1 . "@0.5"));
//
$bplot->SetShadow(array(COLOR1 . "@0.7"), 5, 5);
$bplot->SetColor(array(COLOR1 . "@1"));
//
$graph->Add($bplot);
$graph->xaxis->SetTickLabels($labelx);
//$graph->xaxis->SetLabelAngle(40); // only with TTF fonts
$graph->title->Set($title);
$graph->xaxis->title->Set($titley);
$graph->yaxis->title->Set($titlex);
$graph->Stroke();
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:incidents_bar_graph.php

示例13: BarPlot

$graph->xaxis->SetTickLabels($BPK);
$graph->xaxis->SetFont(FF_FONT1);
$graph->xaxis->SetColor('darkblue', 'black');
//$graph->yaxis->SetLabelFormatCallback('formatNumber_money');
// Setup "hidden" y-axis by given it the same color
// as the background
$graph->yaxis->SetColor('black', 'black');
$graph->ygrid->SetColor('white');
// Setup graph title ands fonts
$graph->title->Set(gettext("GRAFIK"));
$graph->title->SetFont(FF_FONT1, FS_BOLD, 16);
//$graph->subtitle->Set('(With "hidden" y-axis)');
// Create a bar pot
$bplot = new BarPlot($totals);
$bplot->SetFillColor('darkblue');
$bplot->SetColor('black');
$bplot->SetWidth(0.5);
$bplot->SetShadow('darkgray');
// Setup the values that are displayed on top of each bar
$bplot->value->Show();
// Must use TTF fonts if we want text at an arbitrary angle
$bplot->value->SetFont(FF_FONT1, FS_NORMAL, 8);
//$bplot->value->SetFormatCallback('formatNumber');
// $bplot->value->SetFormat($aLocaleInfo["currency_symbol"] . ' %d');
// $bplot->value->SetFormat('%01.0f');
// Dark blue for positive values and darkred for negative values
$bplot->value->SetColor("darkblue", "darkred");
$graph->Add($bplot);
// Finally stroke the graph
$graph->Stroke();
?>
开发者ID:vikingkarwur,项目名称:smjgpib,代码行数:31,代码来源:BPKbar.php

示例14: print_graph


//.........这里部分代码省略.........
    }
    if (count($data) > 0 && $type) {
        $figure_file = "graph_cache/" . rand(11111, 999999999) . "." . $img_type;
        if ($bandw) {
            $colours = array('snow1', 'black', 'snow4', 'snow3', 'snow2', 'cadetblue4', 'cadetblue3', 'cadetblue1', 'bisque4', 'bisque2', 'beige');
        } else {
            $colours = array('cyan', 'darkorchid4', 'cadetblue3', 'khaki1', 'darkolivegreen2', 'cadetblue4', 'coral', 'cyan4', 'rosybrown3', 'wheat1');
        }
        $fills = array('navy', 'orange', 'red', 'yellow', 'purple', 'navy', 'orange', 'red', 'yellow', 'purple');
        $patterns = array(PATTERN_DIAG1, PATTERN_CROSS1, PATTERN_STRIPE1, PATTERN_DIAG3, PATTERN_CROSS2, PATTERN_DIAG2, PATTERN_DIAG4, PATTERN_CROSS3, PATTERN_CROSS4, PATTERN_STRIPE1);
        $markers = array(MARK_DIAMOND, MARK_SQUARE, MARK_CIRCLE, MARK_UTRIANGLE, MARK_DTRIANGLE, MARK_FILLEDCIRCLE, MARK_CROSS, MARK_STAR, MARK_X);
        // LEGENDS
        if ($type == 'pie' || $type == 'pie3d') {
            $graph = new PieGraph($w * $k, $h * $k);
        } else {
            if ($type == 'radar') {
                $graph = new RadarGraph($w * $k, $h * $k);
            } else {
                $graph = new Graph($w * $k, $h * $k);
            }
        }
        // mPDF 4.5.009
        //	$graph->img->SetImgFormat($img_type) ;
        //	if (strtoupper($img_type)=='JPEG') { $graph->img->SetQuality(90); }
        if ($antialias) {
            $graph->img->SetAntiAliasing();
        }
        $graph->SetShadow(true, 2 * $k);
        $graph->SetMarginColor("white");
        // TITLE
        $graph->title->Set($title);
        $graph->title->SetMargin(10 * $k);
        $graph->title->SetFont(FF_USERFONT, FS_BOLD, 11 * $k);
        $graph->title->SetColor("black");
        $graph->legend->SetLineSpacing(3 * $k);
        $graph->legend->SetMarkAbsSize(6 * $k);
        $graph->legend->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
        // Set GRAPH IMAGE MARGINS
        if ($type == 'pie' || $type == 'pie3d') {
            $psize = 0.3;
            $pposxabs = $w / 2;
            $pposy = 0.55;
            if ($longestlegend) {
                // if legend showing
                $pposxabs -= ($longestlegend * 5 + 20) / 2;
            }
            $pposx = $pposxabs / $w;
            $graph->legend->Pos(0.02, 0.5, 'right', 'center');
        } else {
            if ($type == 'radar') {
                $psize = 0.5;
                $pposxabs = $w / 2;
                $pposy = 0.55;
                if ($longestlabel) {
                    // if legend showing
                    $pposxabs -= ($longestlabel * 5 + 20) / 2;
                }
                $pposx = $pposxabs / $w;
                $graph->legend->Pos(0.02, 0.5, 'right', 'center');
            } else {
                if ($type == 'xy' || $type == 'scatter') {
                    $pml = 50;
                    $pmr = 20;
                    $pmt = 60;
                    $pmb = 50;
                    $xaxislblmargin = $pmb - 30;
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:67,代码来源:graph.php

示例15:

$bplot->SetColor('#94D239');
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->SetLegend("ANSWERED");
$bplot1->SetFillColor('#376BF6');
$bplot1->SetColor('#376BF6');
$bplot1->value->Show();
$bplot1->value->SetFormat('%d');
$bplot1->SetLegend("BUSY");
/*$bplot2->SetFillColor('#C40505');
$bplot2->SetColor('#C40505');
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->SetLegend("UNSUCCESSFULL");*/
$bplot3->SetFillColor('#A7A7A7');
$bplot3->SetColor('#A7A7A7');
$bplot3->value->Show();
$bplot3->value->SetFormat('%d');
$bplot3->SetLegend("NOANSWER");
// Setup the titles
$graph->title->Set("Total monthly calls breakdown by status");
$graph->xaxis->title->Set("Month");
$graph->yaxis->title->Set("Calls");
$graph->yaxis->SetLabelAlign('center', 'top');
$graph->legend->SetColumns(4);
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetPos(0.5, 0.14, 'center', 'bottom');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// Display the graph
开发者ID:infercom2,项目名称:rccn,代码行数:31,代码来源:total_calls_status-m.php


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