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


PHP BarPlot::SetLegend方法代码示例

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


在下文中一共展示了BarPlot::SetLegend方法的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: grafico_2_bd

 public function grafico_2_bd()
 {
     require_once APPPATH . '/libraries/JpGraph/jpgraph_bar.php';
     $data1y = $this->id_asignacionprueba;
     $data2y = $this->curso_id_curso;
     $graph = new Graph(700, 360, "auto");
     $graph->SetScale("textlin");
     $graph->img->SetMargin(30, 30, 20, 65);
     $graph->ygrid->SetFill(true, '#fff', '#DDDDDD@0.5');
     $graph->SetMarginColor("#fff");
     $graph->SetFrame(true, '#fff', 1);
     $graph->SetBox(false);
     //$columnas_2 = array('Ext. Info Explicita','Ext. Info Implicita','Ref. Contenido Texto','Ref. Sobre Texto');
     //$graph->xaxis->SetTickLabels($columnas_2);
     $b1plot = new BarPlot($data1y);
     $b1plot->SetWeight(0);
     $b1plot->SetFillColor("#61A9F3");
     $b1plot->SetLegend("id asignacion");
     $b1plot->SetValuePos('center');
     $b2plot = new BarPlot($data2y);
     $b2plot->SetWeight(0);
     $b2plot->SetFillColor("#F381B9");
     $b2plot->SetLegend("id curso");
     $b2plot->SetValuePos('center');
     $gbplot = new AccBarPlot(array($b1plot, $b2plot));
     $graph->Add($gbplot);
     $b1plot->value->Show();
     $b2plot->value->Show();
     $b1plot->value->SetFormat('%d');
     $b2plot->value->SetFormat('%d');
     $graph->title->Set("Grafico 2 - de barras compuestas");
     $graph->legend->SetPos(0.5, 0.99, 'center', 'bottom');
     $graph->legend->SetFrameWeight(1);
     $graph->Stroke(_IMG_HANDLER);
     global $fileName_bd_2;
     $this->fileName_bd_2 = "assets/images/grafica_muestra_bd_2.jpg";
     $graph->img->Stream($this->fileName_bd_2);
     /*
     $graph->img->Headers();
     $graph->img->Stream();
     */
 }
开发者ID:aeduc,项目名称:mideteed,代码行数:42,代码来源:Grafico.php

示例3: Text

$graph->SetColor(array(250, 250, 250));
$graph->img->SetTransparent("white");
$t1 = new Text("This is a text");
$t1->SetPos(0.5, 0.5);
$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_BOLD);
$t1->SetBox("white", "black", "gray");
$t1->SetColor("black");
$graph->AddText($t1);
// Create the linear error plot
$l1plot = new LinePlot($l1datay);
$l1plot->SetColor("blue");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$l2plot = new BarPlot($l2datay);
$l2plot->SetFillColor("orange");
$l2plot->SetLegend("Result");
// Add the plots to the graph
$graph->Add($l1plot);
$graph->Add($l2plot);
$graph->title->Set("Example 16.3");
$graph->xaxis->title->Set("Month");
$graph->yaxis->title->Set("x10,000 US\$");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTickLabels($datax);
//$graph->xaxis->SetTextTickInterval(2);
// Display the graph
$graph->Stroke();
开发者ID:jeromecc,项目名称:tuv2,代码行数:31,代码来源:example16.5.php

示例4: BarPlot

$graph->title->Set('Energi - Energiforbruk ditt areal');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Creates the bars
$bplot1 = new BarPlot($datay1);
$bplot2 = new BarPlot($datay2);
$bplot3 = new BarPlot($datay3);
// Gets the names for the database to be used as legend on the picture
if ($stmt = $mysqli->prepare("SELECT legend1, legend2, legend3 \n                                    FROM legend\n\t\t\t\t\t\t\t\t\tWHERE tabell = 'Energi - Energiforbruk ditt areal - Kristiansand' \n\t\t\t\t\t\t\t\t\tLIMIT 1")) {
    $stmt->execute();
    $stmt->store_result();
    $stmt->bind_result($legend1, $legend2, $legend3);
    $stmt->fetch();
}
$bplot1->SetLegend($legend1);
$bplot2->SetLegend($legend2);
$bplot3->SetLegend($legend3);
// To gather the bar plots close to eachother
$gbarplot = new GroupBarPlot(array($bplot1, $bplot2, $bplot3));
$gbarplot->SetWidth(0.8);
$graph->Add($gbarplot);
// draws the barplots
$bplot1->value->Show();
$bplot2->value->Show();
$bplot3->value->Show();
$bplot1->value->SetFormat('%01d');
$bplot2->value->SetFormat('%01d');
$bplot3->value->SetFormat('%01d');
$bplot1->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot2->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot3->value->SetFont(FF_ARIAL, FS_BOLD, 10);
$bplot1->value->SetAngle(45);
开发者ID:Gaugen,项目名称:IS-304,代码行数:31,代码来源:energi_kristiansand.php

示例5: renderXYPlot

 /**
  * Draw the XY type plot
  *
  * @param array $data plot data array reference
  * @param array $xmlArr xml array reference
  * @return object refernce XY plot object reference
  */
 public function renderXYPlot(&$data, &$xmlArr)
 {
     $id = $xmlArr['ATTRIBUTES']['ID'];
     $field = $xmlArr['ATTRIBUTES']['FIELD'];
     $chartType = $xmlArr['ATTRIBUTES']['CHARTTYPE'];
     $pointType = $xmlArr['ATTRIBUTES']['POINTTYPE'];
     $weight = $xmlArr['ATTRIBUTES']['WEIGHT'];
     $color = $xmlArr['ATTRIBUTES']['COLOR'];
     $fillColor = $xmlArr['ATTRIBUTES']['FILLCOLOR'];
     $showVal = $xmlArr['ATTRIBUTES']['SHOWVALUE'];
     $legend = $xmlArr['ATTRIBUTES']['LEGENDFIELD'];
     $visible = $xmlArr['ATTRIBUTES']['VISIBLE'];
     if ($chartType == 'Line' or $chartType == 'Bar') {
         if ($chartType == 'Line') {
             include_once JPGRAPH_DIR . '/jpgraph_line.php';
             $plot = new LinePlot($data);
             $this->_drawMark($plot->mark, $xmlArr['POINTMARK']['ATTRIBUTES']['TYPE'], $xmlArr['POINTMARK']['ATTRIBUTES']['COLOR'], $xmlArr['POINTMARK']['ATTRIBUTES']['FILLCOLOR'], $xmlArr['POINTMARK']['ATTRIBUTES']['SIZE']);
             $plot->SetBarCenter();
             $plot->SetCenter();
         } else {
             if ($chartType == 'Bar') {
                 include_once JPGRAPH_DIR . '/jpgraph_bar.php';
                 $plot = new BarPlot($data);
                 $plot->SetAlign('center');
             }
         }
         if ($color) {
             $plot->SetColor($color);
         }
         if ($fillColor) {
             $plot->SetFillColor($fillColor);
         }
         if ($weight) {
             $plot->SetWeight($weight);
         }
         if ($showVal == 1) {
             $plot->value->Show();
         }
         if ($legend) {
             $plot->SetLegend($legend);
         }
         $this->_drawString($plot->value, $xmlArr['VALUE']['ATTRIBUTES']['FONT'], $xmlArr['VALUE']['ATTRIBUTES']['COLOR']);
     }
     if ($chartType == 'GroupBar' or $chartType == 'AccBar') {
         $children = $xmlArr['ATTRIBUTES']['CHILDREN'];
         $childList = explode(",", $children);
         foreach ($childList as $child) {
             $childPlotList[] = $this->m_PlotList[$child];
         }
         if ($chartType == 'GroupBar') {
             $plot = new GroupBarPlot($childPlotList);
         } else {
             if ($chartType == 'AccBar') {
                 $plot = new AccBarPlot($childPlotList);
             }
         }
     }
     $this->m_PlotList[$id] = $plot;
     if ($visible == 1) {
         return $plot;
     }
     return null;
 }
开发者ID:que273,项目名称:siremis,代码行数:70,代码来源:chartService.php

示例6: LinePlot

// Use built in font
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Make the margin around the plot a little bit bigger
// then default
$graph->img->SetMargin(40, 140, 40, 80);
// Slightly adjust the legend from it's default position in the
// top right corner to middle right side
$graph->legend->Pos(0.05, 0.5, "right", "center");
// Display every 10:th datalabel
$graph->xaxis->SetTextTickInterval(6);
$graph->xaxis->SetTextLabelInterval(2);
$graph->xaxis->SetTickLabels($databarx);
$graph->xaxis->SetLabelAngle(90);
// Create a red line plot
$p1 = new LinePlot($datay);
$p1->SetColor("red");
$p1->SetLegend("Pressure");
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend("Temperature");
$b1->SetAbsWidth(6);
$b1->SetShadow();
// The order the plots are added determines who's ontop
$graph->Add($p1);
$graph->Add($b1);
// Finally output the  image
$graph->Stroke();
?>


开发者ID:hcvcastro,项目名称:pxp,代码行数:28,代码来源:linebarex1.php

示例7: rand

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_bar.php';
// Some data
for ($i = 0; $i < 12; ++$i) {
    $databary[$i] = rand(1, 20);
}
$months = $gDateLocale->GetShortMonth();
// New graph with a drop shadow
$graph = new Graph(300, 200);
$graph->SetShadow();
// Use a "text" X-scale
$graph->SetScale('textlin');
// Specify X-labels
$graph->xaxis->SetTickLabels($months);
$graph->xaxis->SetTextTickInterval(2, 0);
// Set title and subtitle
$graph->title->Set('Textscale with tickinterval=2');
// Use built in font
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create the bar plot
$b1 = new BarPlot($databary);
$b1->SetLegend('Temperature');
// The order the plots are added determines who's ontop
$graph->Add($b1);
// Finally output the  image
$graph->Stroke();
?>


开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:28,代码来源:manual_textscale_ex2.php

示例8: array

$graph->img->SetMargin(40, 30, 20, 160);
//Setup Frame
$graph->SetFrame(true, "#ffffff");
// Setup graph title
//$graph->title->Set($title);
//$graph->title->SetFont(FF_FONT1, FS_BOLD);
$bar_array = array();
$i = 0;
foreach ($final_values as $title => $values) {
    $i %= count($color_list);
    $datay = explode(",", $values);
    $bplot = new BarPlot($datay);
    $bplot->SetWidth(0.7);
    $bplot->SetFillColor($color_list[$i] . "@0.5");
    $bplot->SetColor($color_list[$i] . "@1");
    $bplot->SetLegend($title);
    $bar_array[] = $bplot;
    $i++;
}
// Create the grouped bar plot
$gbplot = new AccBarPlot($bar_array);
$gbplot->SetShadow($color . "@0.9", 6, 5);
$gbplot->SetWidth(0.6);
$graph->Add($gbplot);
$graph->xaxis->SetTickLabels($labelx);
$graph->xaxis->title->Set($titley);
$graph->yaxis->title->Set($titlex);
// Adjust the legend position
$graph->legend->SetColumns(3);
$graph->legend->SetPos(0.5, 0.95, 'center', 'bottom');
$graph->legend->SetShadow('#fafafa', 0);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:incidents_stacked_bar_chart.php

示例9: BarPlot

$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 7);
$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);
//$b4plot = new BarPlot($data4y);
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($b1plot, $b2plot));
// ...and add it to the graPH
$graph->Add($gbplot);
$b1plot->SetColor("white");
$b1plot->SetFillColor("#66cd00");
$b1plot->value->Show();
$b1plot->SetLegend('pos_exercise');
$b2plot->SetColor("white");
$b2plot->SetFillColor("#1c86ee");
$b2plot->value->Show();
$b2plot->SetLegend('mot_exercise');
//$b3plot->SetColor("white");
//$b3plot->SetFillColor("#ee1289");
//$b4plot->SetColor("white");
//$b4plot->SetFillColor("#6600ff");
$graph->title->Set("Weekly Exercise Trends in Warmer Places");
// position the graph
//$mgraph = new MGraph();
//$xpos1=100;$ypos1=3;
//$mgraph->Add($graph,'auto','auto');
// display the graph
$graph->Stroke();
开发者ID:shikha1990,项目名称:HealthMonitoringAnalytics_Group3,代码行数:31,代码来源:Colder-2.php

示例10: BarPlot

$available_n_pages[] = @$n_pages_[PROJ_POST_SECOND_AVAILABLE];
$progordone_n_pages[] = @$n_pages_[PROJ_POST_SECOND_CHECKED_OUT];
// ---------------
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(50, 230, 30, 40);
// ------------------------
// Create the bar plots
$unavail_plot = new BarPlot($unavail_n_pages);
$unavail_plot->SetLegend(_('unavailable'));
$waiting_plot = new BarPlot($waiting_n_pages);
$waiting_plot->SetLegend(_('waiting (to be available)'));
$available_plot = new BarPlot($available_n_pages);
$available_plot->SetLegend(_('available'));
$progordone_plot = new BarPlot($progordone_n_pages);
$progordone_plot->SetLegend(_('in progress or done'));
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($unavail_plot, $waiting_plot, $available_plot, $progordone_plot));
// ...and add it to the graph
$graph->Add($gbplot);
// ------------------------
$graph->title->Set(_("Number of pages in various states"));
$graph->xaxis->title->Set(_("stage"));
// $graph->yaxis->title->Set(_("# pages"));
$graph->xaxis->SetTickLabels($stage_labels);
$graph->title->SetFont($jpgraph_FF, $jpgraph_FS);
$graph->yaxis->title->SetFont($jpgraph_FF, $jpgraph_FS);
$graph->xaxis->title->SetFont($jpgraph_FF, $jpgraph_FS);
// Display the graph
$graph->Stroke();
// vim: sw=4 ts=4 expandtab
开发者ID:cpeel,项目名称:dproofreaders-shadow,代码行数:31,代码来源:pages_in_states.php

示例11: GroupBarPlot

$gbplot = new GroupBarPlot(array($bplot, $bplot1, $bplot2));
// Adjust fill color
$graph->Add($gbplot);
$bplot->SetFillColor('#C40505');
$bplot->SetColor('#C40505');
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->SetLegend("External");
$bplot1->SetFillColor('#94D239');
$bplot1->SetColor('#94D239');
$bplot1->value->Show();
$bplot1->value->SetFormat('%d');
$bplot1->SetLegend("Internal");
$bplot2->SetFillColor('#3925F8');
$bplot2->SetColor('#3925F8');
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->SetLegend("From Outside");
// Setup the titles
$graph->title->Set("Last 4 weeks - Total weekly calls breakdown by context");
$graph->xaxis->title->Set("Week year");
$graph->yaxis->title->Set("Calls");
$graph->yaxis->SetLabelAlign('center', 'top');
$graph->legend->SetColumns(3);
$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
$graph->Stroke();
开发者ID:infercom2,项目名称:rccn,代码行数:31,代码来源:total_calls_context-4w.php

示例12: array

$datay = array(12, 26, 9, 17, 31);
// Create the graph.
$graph = new Graph(400, 250);
$graph->SetScale("textlin");
$graph->SetMargin(50, 80, 20, 40);
$graph->yaxis->SetTitleMargin(30);
$graph->yaxis->scale->SetGrace(30);
$graph->SetShadow();
// Create a bar pot
$bplot = new BarPlot($datay);
// Create targets for the bars image maps. One for each column
$targ = array("bar_clsmex1.php#1", "bar_clsmex1.php#2", "bar_clsmex1.php#3", "bar_clsmex1.php#4", "bar_clsmex1.php#5", "bar_clsmex1.php#6");
$alts = array("val=%d", "val=%d", "val=%d", "val=%d", "val=%d", "val=%d");
$bplot->SetCSIMTargets($targ, $alts);
$bplot->SetFillColor("orange");
$bplot->SetLegend('Year 2001 %%', '#kalle ', '%s');
// Display the values on top of each bar
$bplot->SetShadow();
$bplot->value->SetFormat(" \$ %2.1f", 70);
$bplot->value->SetFont(FF_ARIAL, FS_NORMAL, 9);
$bplot->value->SetColor("blue");
$bplot->value->Show();
$graph->Add($bplot);
// Create a big "button" that has an image map action
$txt1 = new Text("A simple text with\ntwo rows");
$txt1->SetFont(FF_ARIAL);
$txt1->SetBox('lightblue', 'black', 'white@1', 5);
$txt1->SetParagraphAlign('center');
$txt1->SetPos(40, 50);
$txt1->SetCSIMTarget('#88', 'Text element');
$graph->Add($txt1);
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:31,代码来源:titlecsimex01.php

示例13: metric_as_graph


//.........这里部分代码省略.........
                }
                $stddev[$x[$i]] = $rawdata[$i][5];
                if (preg_match('/^[0-9]+:[0-5][0-9]:[0-5][0-9]$/', $stddev[$x[$i]])) {
                    $stddev[$x[$i]] = time_to_hrs($stddev[$x[$i]]);
                }
                $ysigma[2 * $x[$i]] = $y[$x[$i]] - $stddev[$x[$i]];
                if ($ysigma[2 * $x[$i]] < 0.0) {
                    $ysigma[2 * $x[$i]] = 0.0;
                }
                $ysigma[2 * $x[$i] + 1] = $y[$x[$i]] + $stddev[$x[$i]];
            } else {
                $y[$i] = $rawdata[$i][4];
                if (preg_match('/^[0-9]+:[0-5][0-9]:[0-5][0-9]$/', $y[$i])) {
                    $y[$i] = time_to_hrs($y[$i]);
                }
                $min[$i] = $rawdata[$i][2];
                if (preg_match('/^[0-9]+:[0-5][0-9]:[0-5][0-9]$/', $min[$i])) {
                    $min[$i] = time_to_hrs($min[$i]);
                }
                $max[$i] = $rawdata[$i][3];
                if (preg_match('/^[0-9]+:[0-5][0-9]:[0-5][0-9]$/', $max[$i])) {
                    $max[$i] = time_to_hrs($max[$i]);
                }
                $stddev[$i] = $rawdata[$i][5];
                if (preg_match('/^[0-9]+:[0-5][0-9]:[0-5][0-9]$/', $stddev[$i])) {
                    $stddev[$i] = time_to_hrs($stddev[$i]);
                }
                $ysigma[2 * $i] = $y[$i] - $stddev[$i];
                if ($ysigma[2 * $i] < 0.0) {
                    $ysigma[2 * $i] = 0.0;
                }
                $ysigma[2 * $i + 1] = $y[$i] + $stddev[$i];
            }
        }
    }
    $cache = APACHE_CACHE_DIR;
    if (!file_exists("/tmp/" . $cache)) {
        mkdir("/tmp/" . $cache, 0750);
    }
    $plot = $system . "-" . $metric . "_vs_" . $xaxis . "-" . $start_date . "-" . $end_date . ".png";
    //  $graph = new graph(640,480,$plot,2,0);
    $graph = new graph(800, 600, $plot, 2, 0);
    $graph->img->SetMargin(75, 30, 30, 75);
    if ($xaxis == 'nproc') {
        $graph->SetScale("linlin");
        //$graph->xaxis->SetAutoMax(nprocs($system));
    } else {
        $graph->SetScale("textlin");
        $graph->xaxis->SetLabelAngle(90);
        $graph->xaxis->SetTickLabels($x);
    }
    $graph->xaxis->title->Set($xaxis);
    $graph->yaxis->title->Set($metric . units($metric));
    if ($metric == "walltime_acc" || $metric == "cpu_eff") {
        $graph->yscale->SetAutoMax(1.1);
    } elseif ($metric == "xfactor") {
        $graph->yscale->SetAutoMin(1.0);
    }
    if ($metric != "jobcount" && $metric != "cpuhours" && $metric != "backlog" && $metric != "xfactor" && $metric != "users" && $metric != "groups") {
        $maxbar = new BarPlot($max);
        $maxbar->SetWidth(1.0);
        $maxbar->SetFillColor("gray");
        $maxbar->SetLegend("Maximum");
        $graph->Add($maxbar);
    } else {
        if ($metric == "backlog") {
            $maxbar = new BarPlot($max);
            $maxbar->SetWidth(1.0);
            $maxbar->SetFillColor("gray");
            $maxbar->SetLegend("CPU Hours");
            $graph->Add($maxbar);
        }
    }
    $ybar = new BarPlot($y);
    $ybar->SetWidth(1.0);
    if ($metric != "jobcount" && $metric != "cpuhours" && $metric != "backlog" && $metric != "xfactor" && $metric != "users" && $metric != "groups") {
        $ybar->SetLegend("Mean");
    } else {
        if ($metric == "backlog") {
            $ybar->SetLegend("Queue Hours");
        }
    }
    $graph->Add($ybar);
    if ($metric != "jobcount" && $metric != "cpuhours" && $metric != "backlog" && $metric != "xfactor" && $metric != "users" && $metric != "groups") {
        $minbar = new BarPlot($min);
        $minbar->SetWidth(1.0);
        $minbar->SetFillColor("white");
        $minbar->SetLegend("Minimum");
        $graph->Add($minbar);
        $errbars = new ErrorPlot($ysigma);
        $errbars->SetColor("red");
        //$errbars->SetCenter();
        $errbars->SetWeight(2);
        $errbars->SetLegend("Std.Dev.");
        $graph->Add($errbars);
    }
    $graph->Stroke();
    $imgurl = $cache . rawurlencode($plot);
    echo "<img src=\"" . $imgurl . "\">\n";
}
开发者ID:Norky,项目名称:PBS-tools,代码行数:101,代码来源:metrics.php

示例14: Graph

$graph = new Graph(500, 200);
$graph->img->SetMargin(60, 150, 30, 50);
$graph->SetScale("textlin");
$graph->SetMarginColor("silver");
$graph->SetShadow();
// Set up the title for the graph
$graph->title->Set("Example negative bars");
$graph->title->SetFont(FF_VERDANA, FS_NORMAL, 16);
$graph->title->SetColor("darkred");
// Setup font for axis
$graph->xaxis->SetFont(FF_VERDANA, FS_NORMAL, 10);
$graph->yaxis->SetFont(FF_VERDANA, FS_NORMAL, 10);
// Show 0 label on Y-axis (default is not to show)
$graph->yscale->ticks->SupressZeroLabel(false);
// Setup X-axis labels
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(50);
// Set X-axis at the minimum value of Y-axis (default will be at 0)
$graph->xaxis->SetPos("min");
// "min" will position the x-axis at the minimum value of the Y-axis
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
$bplot->SetLegend("Result 1999", "blue");
// Setup color for gradient fill style
$bplot->SetFillGradient("navy", "steelblue", GRAD_MIDVER);
// Set color for the frame of each bar
$bplot->SetColor("navy");
$graph->Add($bplot);
// Finally send the graph to the browser
$graph->Stroke();
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:bargradex6.php

示例15: graph_group_pct

function graph_group_pct($p_title = '', $p_graph_width = 350, $p_graph_height = 400)
{
    global $enum_name, $enum_name_count;
    global $open_bug_count, $closed_bug_count, $resolved_bug_count;
    error_check($open_bug_count + $closed_bug_count + $resolved_bug_count, $p_title);
    $graph = new Graph(250, 400);
    $graph->img->SetMargin(35, 35, 35, 150);
    if (ON == config_get_global('jpgraph_antialias')) {
        $graph->img->SetAntiAliasing();
    }
    $graph->SetScale('textlin');
    $graph->SetMarginColor('white');
    $graph->SetFrame(false);
    $graph->title->Set($p_title);
    $graph->xaxis->SetTickLabels($enum_name);
    $graph->xaxis->SetLabelAngle(90);
    $graph->yaxis->scale->ticks->SetDirection(-1);
    $p1 = new BarPlot($open_bug_count);
    $p1->SetFillColor('yellow');
    $p1->SetWidth(0.8);
    $p1->SetLegend(lang_get('legend_opened'));
    $p2 = new BarPlot($closed_bug_count);
    $p2->SetFillColor('blue');
    $p2->SetWidth(0.8);
    $p2->SetLegend(lang_get('legend_closed'));
    $p3 = new BarPlot($resolved_bug_count);
    $p3->SetFillColor('red');
    $p3->SetWidth(0.8);
    $p3->SetLegend(lang_get('legend_resolved'));
    $gbplot = new GroupBarPlot(array($p1, $p2, $p3));
    $graph->Add($gbplot);
    if (helper_show_queries()) {
        $graph->subtitle->Set(db_count_queries() . ' queries (' . db_count_unique_queries() . ' unique)');
    }
    $graph->Stroke();
}
开发者ID:jin255ff,项目名称:company_website,代码行数:36,代码来源:graph_api.php


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