本文整理汇总了PHP中LinePlot::SetLegend方法的典型用法代码示例。如果您正苦于以下问题:PHP LinePlot::SetLegend方法的具体用法?PHP LinePlot::SetLegend怎么用?PHP LinePlot::SetLegend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinePlot
的用法示例。
在下文中一共展示了LinePlot::SetLegend方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildGraph
/**
* @return Chart
*/
public function buildGraph()
{
require_once 'common/chart/Chart.class.php';
if ($this->error == NULL) {
if ($this->width == 0) {
$this->width = count($this->data) * self::WIDTH_PER_POINT + self::MARGIN;
}
if ($this->scale == GraphOnTrackersV5_Chart_CumulativeFlow::SCALE_DAY) {
foreach ($this->data as $date => $label) {
$dates[] = date('M-d', $date);
}
} else {
foreach ($this->data as $date => $label) {
$dates[] = date('M-Y', $date);
}
}
$this->graph = new Chart($this->width, $this->height);
$colors = $this->getColors();
$this->graph->SetScale("datlin");
$this->graph->title->Set($this->title);
$this->graph->xaxis->SetTickLabels($dates);
$this->graph->yaxis->scale->SetAutoMin(0);
if (is_null($this->description)) {
$this->description = "";
}
$this->graph->subtitle->Set($this->description);
$this->keys = array_keys($this->data[$this->start_date]);
$this->nbOpt = count($this->keys);
$this->stackDataCount();
$this->graph->ygrid->SetFill(true, '#F3FFFF@0.5', '#FFFFFF@0.5');
for ($i = $this->nbOpt - 1; $i >= 0; $i--) {
$lineData = array();
foreach ($this->data as $data => $row) {
$lineData[] = $row[$this->keys[$i]];
}
$line = new LinePlot($lineData);
$line->SetFillColor($colors[$this->keys[$i]]);
$line->SetColor('#000');
$line->SetLegend($this->keys[$i]);
$this->graph->Add($line);
}
try {
$legend_line_height = 20;
$graph_margin_bottom = 70;
$margin_size = $this->nbOpt * $legend_line_height + $graph_margin_bottom;
$this->graph->img->SetMargin(70, 30, 30, $margin_size);
} catch (Exception $e) {
// do nothing, JPGraph displays the error by itself
}
$this->graph->legend->SetAbsPos(0, $this->height, 'left', 'bottom');
} else {
$this->graph = $this->error;
}
return $this->graph;
}
示例2: renderGraph
public function renderGraph()
{
require_once 'libs/jpgraph/jpgraph.php';
require_once 'libs/jpgraph/jpgraph_bar.php';
require_once 'libs/jpgraph/jpgraph_line.php';
$graph = new Graph(300, 200, 'auto');
$graph->SetMarginColor('white');
$graph->SetFrame(false);
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->img->SetMargin(0, 30, 20, 65);
$graph->yaxis->HideLabels();
$graph->yaxis->HideTicks();
$graph->yaxis->scale->SetGrace(20);
$graph->y2axis->SetColor("black", "red");
$graph->ygrid->SetFill(true, '#EFEFEF@0.5', '#BBCCFF@0.5');
$labelsy = array();
$datay = array();
$datay2 = array();
switch ($this->_controllerAction->getRequest()->getParam('type')) {
case 'year':
$this->_populateYearData($labelsy, $datay, $datay2);
break;
default:
$this->_populateWeekData($labelsy, $datay, $datay2);
}
$graph->xaxis->SetTickLabels($labelsy);
$locale = Zend_Registry::get('Zend_Locale');
if ($locale == 'ja') {
// the ttf file for FF_MINCHO is already encoded in utf-8
$legend1 = $this->view->translate('Trusted sites');
$legend2 = $this->view->translate('Sites per user');
} else {
// default ttf files are latin-1 encoded
$legend1 = utf8_decode($this->view->translate('Trusted sites'));
$legend2 = utf8_decode($this->view->translate('Sites per user'));
}
$bplot = new BarPlot($datay);
$bplot->setLegend($legend1);
$bplot->SetFillGradient("navy", "lightsteelblue", GRAD_WIDE_MIDVER);
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$p1 = new LinePlot($datay2);
$p1->SetColor("red");
$p1->SetLegend($legend2);
$graph->Add($bplot);
$graph->AddY2($p1);
$graph->legend->SetLayout(LEGEND_HOR);
if ($locale == 'ja') {
$graph->legend->setFont(FF_MINCHO, FS_NORMAL);
}
$graph->legend->Pos(0.5, 0.99, "center", "bottom");
$graph->Stroke();
}
示例3: LineGraph
function LineGraph($w, $h, $title, $data1, $data2, $datax, $output)
{
// Create the graph. These two calls are always required
$graph = new Graph($w, $h, "auto");
$graph->SetScale("textlin");
$graph->SetMarginColor('white');
$graph->SetFrame(true);
// Adjust the margin
$graph->img->SetMargin(40, 100, 20, 40);
$graph->SetShadow(false);
// Create the linear plot
$lineplot = new LinePlot($data1);
$lineplot->SetWeight(2);
$lineplot->SetColor("blue");
$lineplot->mark->SetType(MARK_DIAMOND);
$lineplot->mark->SetWidth(5);
$lineplot->mark->SetFillColor('blue');
$lineplot->value->SetMargin(-20);
$lineplot->value->show();
$lineplot->value->SetColor('blue');
$lineplot->value->SetFormat('%0.0f');
$lineplot->SetLegend($_SESSION[Tahun1]);
$lineplot2 = new LinePlot($data2);
$lineplot2->SetColor("green");
$lineplot2->SetWeight(2);
$lineplot2->mark->SetType(MARK_FILLEDCIRCLE);
$lineplot2->mark->SetWidth(3);
$lineplot2->mark->SetFillColor('green');
$lineplot2->value->show();
$lineplot2->value->SetColor('darkgreen');
$lineplot2->value->SetFormat('%0.0f');
$lineplot2->SetLegend($_SESSION[Tahun2]);
// Add the plot to the graph
$graph->Add($lineplot);
$graph->xaxis->SetTickLabels($datax);
$graph->title->Set($title);
$graph->xaxis->title->Set("");
$graph->yaxis->title->Set("");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->Add($lineplot2);
$graph->legend->SetShadow(false);
$graph->legend->SetFillColor('white');
$graph->legend->SetPos(0.01, 0.88, 'right', 'center');
// Display the graph
$graph->Stroke($output);
}
示例4: draw_bmi
function draw_bmi($actual, $graph_details)
{
$arr_bmi_bound = get_bmi_bound();
$arr_xlabel = $_SESSION["consult_date"];
$arr_under = $arr_bmi_bound["Underweight"];
$arr_normal = $arr_bmi_bound["Normal"];
$arr_over = $arr_bmi_bound["Overweight"];
$arr_obese = $arr_bmi_bound["Obese"];
$w = 400;
$h = 300;
$graph = new Graph($w, $h);
$graph->SetScale('intlin', 0, 50);
$graph->SetMargin(40, 40, 40, 60);
$graph->title->Set($graph_details[0] . ' of ' . get_px_name());
$graph->xaxis->title->Set($graph_details[1]);
$graph->yaxis->title->Set($graph_details[2]);
$graph->xaxis->SetTickLabels($arr_xlabel);
$lineplot = new LinePlot($actual);
$lineplot->SetColor('blue');
$lineplot->SetWeight(2);
$lineplot->value->Show();
$bmi_under = new LinePlot($arr_under);
$bmi_under->SetColor('yellow');
$bmi_under->SetWeight(3);
$bmi_normal = new LinePlot($arr_normal);
$bmi_normal->SetColor('green');
$bmi_normal->SetWeight(3);
$bmi_over = new LinePlot($arr_over);
$bmi_over->SetColor('red');
$bmi_over->SetWeight(3);
$lineplot->SetLegend('Actual BMI');
$bmi_under->SetLegend('Normal');
$bmi_normal->SetLegend('Overweight');
$bmi_over->SetLegend('Obese');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.5, 0.99, 'center', 'bottom');
$graph->Add($bmi_under);
$graph->Add($bmi_normal);
$graph->Add($bmi_over);
$graph->Add($lineplot);
$graph->Stroke();
}
示例5: draw_graph
function draw_graph($datay, $data2y, $label_x)
{
include_once "src/jpgraph.php";
include_once "src/jpgraph_line.php";
// A nice graph with anti-aliasing
$graph = new Graph(800, 600, "auto");
$graph->img->SetMargin(40, 180, 40, 40);
$graph->img->SetAntiAliasing("white");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set("Nodes and Comment Count By Duration");
$graph->xaxis->SetTickLabels($label_x);
// Use built in font
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Slightly adjust the legend from it's default position in the
// top right corner.
$graph->legend->Pos(0.05, 0.5, "right", "center");
// Create the first line
if ($datay) {
$p1 = new LinePlot($datay);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("blue");
$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Nodes Count");
$graph->Add($p1);
}
// ... and the second
if ($data2y) {
$p2 = new LinePlot($data2y);
$p2->mark->SetType(MARK_STAR);
$p2->mark->SetFillColor("red");
$p2->mark->SetWidth(4);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("Comments Count");
$graph->Add($p2);
}
// Output line
$graph->Stroke();
}
示例6: buildGraph
/**
* @return Chart
*/
public function buildGraph()
{
$graph = new Chart($this->width, $this->height);
$graph->SetScale("datlin");
$graph->title->Set($this->title);
$graph->subtitle->Set($this->description);
$colors = $graph->getThemedColors();
$graph->xaxis->SetTickLabels($this->burndown_data->getHumanReadableDates());
$remaining_effort = new LinePlot($this->burndown_data->getRemainingEffort());
$remaining_effort->SetColor($colors[1] . ':0.7');
$remaining_effort->SetWeight(2);
$remaining_effort->SetLegend('Remaining effort');
$remaining_effort->mark->SetType(MARK_FILLEDCIRCLE);
$remaining_effort->mark->SetColor($colors[1] . ':0.7');
$remaining_effort->mark->SetFillColor($colors[1]);
$remaining_effort->mark->SetSize(3);
$graph->Add($remaining_effort);
$ideal_burndown = new LinePlot($this->burndown_data->getIdealEffort());
$ideal_burndown->SetColor($colors[0] . ':1.25');
$ideal_burndown->SetLegend('Ideal Burndown');
$graph->Add($ideal_burndown);
return $graph;
}
示例7: time
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_line.php';
require_once 'jpgraph/jpgraph_date.php';
// Create a data set in range (50,70) and X-positions
DEFINE('NDATAPOINTS', 360);
DEFINE('SAMPLERATE', 240);
$start = time();
$end = $start + NDATAPOINTS * SAMPLERATE;
$data = array();
$xdata = array();
for ($i = 0; $i < NDATAPOINTS; ++$i) {
$data[$i] = rand(50, 70);
$xdata[$i] = $start + $i * SAMPLERATE;
}
// Create the new graph
$graph = new Graph(540, 300);
// Slightly larger than normal margins at the bottom to have room for
// the x-axis labels
$graph->SetMargin(40, 40, 30, 130);
// Fix the Y-scale to go between [0,100] and use date for the x-axis
$graph->SetScale('datlin', 0, 100);
$graph->title->Set("Example on Date scale");
// Set the angle for the labels to 90 degrees
$graph->xaxis->SetLabelAngle(90);
$line = new LinePlot($data, $xdata);
$line->SetLegend('Year 2005');
$line->SetFillColor('lightblue@0.5');
$graph->Add($line);
$graph->Stroke();
示例8: array
<?php
include "../jpgraph.php";
include "../jpgraph_line.php";
$ydata = array(12, 17, 22, 19, 5, 15);
$graph = new Graph(270, 170);
$graph->SetMargin(30, 90, 30, 30);
$graph->SetScale("textlin");
$graph->img->SetAngle(90);
$graph->img->SetCenter(floor(270 / 2), floor(170 / 2));
$line = new LinePlot($ydata);
$line->SetLegend('2002');
$line->SetColor('darkred');
$line->SetWeight(2);
$graph->Add($line);
// Output graph
$graph->Stroke();
?>
示例9: 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();
?>
示例10: LinePlot
$graph->SetMargin(75, 30, 30, 45);
$graph->legend->SetFont(FF_FONT1, FS_NORMAL);
$lineplot = new LinePlot($tot_data, $ticks);
$lineplot->SetLegend('Traffic total');
$lineplot->SetColor('#d5d5d5');
$lineplot->SetFillColor('#d5d5d5@0.5');
// $lineplot2 = new LinePlot($tot_data_inv, $ticks);
// $lineplot2->SetColor("#d5d5d5");
// $lineplot2->SetFillColor("#d5d5d5@0.5");
$lineplot_in = new LinePlot($in_data, $ticks);
$lineplot_in->SetLegend('Traffic In');
$lineplot_in->SetColor('darkgreen');
$lineplot_in->SetFillColor('lightgreen@0.4');
$lineplot_in->SetWeight(1);
$lineplot_out = new LinePlot($out_data_inv, $ticks);
$lineplot_out->SetLegend('Traffic Out');
$lineplot_out->SetColor('darkblue');
$lineplot_out->SetFillColor('lightblue@0.4');
$lineplot_out->SetWeight(1);
if ($_GET['95th']) {
$lineplot_95th = new LinePlot($per_data, $ticks);
$lineplot_95th->SetColor('red');
}
if ($_GET['ave']) {
$lineplot_ave = new LinePlot($ave_data, $ticks);
$lineplot_ave->SetColor('red');
}
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.52, 0.9, 'center');
$graph->Add($lineplot);
// $graph->Add($lineplot2);
示例11: displayGraph
//.........这里部分代码省略.........
return;
}
if ($G_TYPE == 'lineplot') {
$graph = new Graph($G_SIZE[0], $G_SIZE[1], "auto");
if ($G_SHADOW) {
$graph->SetShadow();
}
$graph->SetScale($G_SCALE);
$graph->SetMarginColor($G_COLOR);
$graph->title->Set($G_TITLE);
$graph->SetFrame(true, '#999999');
$graph->img->SetMargin($G_MARGIN[0], $G_MARGIN[1], $G_MARGIN[2], $G_MARGIN[3]);
$graph->img->SetAntiAliasing();
$graph->xaxis->SetLabelFormatCallback("CallBack");
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->Set($G_LABEL[0]);
$graph->yaxis->title->Set($G_LABEL[1]);
$graph->xgrid->Show();
$graph->legend->SetFillColor("#fafafa");
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
$graph->legend->SetColor("#444444", "#999999");
$arr_lineplot = array();
foreach ($G_YDATAS as $num => $yDatas) {
$lineplot = new LinePlot($yDatas);
if ($G_ARR_STEP[$num] == true) {
$lineplot->SetStepStyle();
}
if ($G_ARR_FILL_COLOR[$num] == true) {
$lineplot->SetFillColor($G_ARR_COLOR[$num]);
}
$lineplot->SetColor($G_ARR_COLOR[$num]);
$lineplot->SetWeight($G_WEIGHT);
$lineplot->SetLegend($G_ARR_LEYEND[$num]);
$arr_lineplot[] = $lineplot;
}
foreach ($arr_lineplot as $num => $yDatas) {
$graph->Add($yDatas);
}
if (sizeof($xData) > 100) {
$graph->xaxis->SetTextTickInterval((int) (sizeof($xData) / 10));
}
$graph->Stroke();
} else {
if ($G_TYPE == 'plot3d') {
$graph = new PieGraph($G_SIZE[0], $G_SIZE[1], "auto");
if ($G_SHADOW) {
$graph->SetShadow();
}
$dataMarginColor = isset($result["ATTRIBUTES"]["MARGIN_COLOR"]) ? $result["ATTRIBUTES"]["MARGIN_COLOR"] : "#999999";
$dataSizePie = isset($result["ATTRIBUTES"]["SIZE_PIE"]) ? $result["ATTRIBUTES"]["SIZE_PIE"] : "80";
$graph->SetMarginColor($G_COLOR);
$graph->SetFrame(true, $dataMarginColor);
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->legend->SetFillColor("#fafafa");
$graph->legend->SetColor("#444444", "#999999");
$graph->legend->SetShadow('gray@0.6', 4);
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
$graph->title->Set($G_TITLE);
$pieplot3d = new PiePlot3d($G_YDATAS[0]);
$pieplot3d->SetSliceColors($G_ARR_COLOR);
$pieplot3d->SetCenter(0.4);
$pieplot3d->SetSize($dataSizePie);
$pieplot3d->SetAngle(45);
$pieplot3d->SetStartAngle(45);
$pieplot3d->value->SetColor('black');
示例12: graph_cumulative_bydate
function graph_cumulative_bydate($p_metrics, $p_graph_width = 300, $p_graph_height = 380)
{
$t_graph_font = graph_get_font();
error_check(is_array($p_metrics) ? count($p_metrics) : 0, plugin_lang_get('cumulative') . ' ' . lang_get('by_date'));
if (plugin_config_get('eczlibrary') == ON) {
$graph = new ezcGraphLineChart();
$graph->background->color = '#FFFFFF';
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$graph->data[0] = new ezcGraphArrayDataSet($p_metrics[0]);
$graph->data[0]->label = plugin_lang_get('legend_reported');
$graph->data[0]->color = '#FF0000';
$graph->data[1] = new ezcGraphArrayDataSet($p_metrics[1]);
$graph->data[1]->label = plugin_lang_get('legend_resolved');
$graph->data[1]->color = '#0000FF';
$graph->data[2] = new ezcGraphArrayDataSet($p_metrics[2]);
$graph->data[2]->label = plugin_lang_get('legend_still_open');
$graph->data[2]->color = '#000000';
$graph->additionalAxis[2] = $nAxis = new ezcGraphChartElementNumericAxis();
$nAxis->chartPosition = 1;
$nAxis->background = '#005500';
$nAxis->border = '#005500';
$nAxis->position = ezcGraph::BOTTOM;
$graph->data[2]->yAxis = $nAxis;
$graph->xAxis->labelCallback = 'graph_date_format';
$graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
$graph->xAxis->axisLabelRenderer->angle = -45;
$graph->legend->position = ezcGraph::BOTTOM;
$graph->legend->background = '#FFFFFF80';
$graph->driver = new ezcGraphGdDriver();
//$graph->driver->options->supersampling = 1;
$graph->driver->options->jpegQuality = 100;
$graph->driver->options->imageFormat = IMG_JPEG;
$graph->title = plugin_lang_get('cumulative') . ' ' . lang_get('by_date');
$graph->options->font = $t_graph_font;
$graph->renderToOutput($p_graph_width, $p_graph_height);
} else {
foreach ($p_metrics[0] as $i => $vals) {
if ($i > 0) {
$plot_date[] = $i;
$reported_plot[] = $p_metrics[0][$i];
$resolved_plot[] = $p_metrics[1][$i];
$still_open_plot[] = $p_metrics[2][$i];
}
}
$graph = new Graph($p_graph_width, $p_graph_height);
$graph->img->SetMargin(40, 40, 40, 170);
if (ON == plugin_config_get('jpgraph_antialias')) {
$graph->img->SetAntiAliasing();
}
$graph->SetScale('linlin');
$graph->yaxis->SetColor("red");
$graph->SetY2Scale("lin");
$graph->SetMarginColor('white');
$graph->SetFrame(false);
$graph->title->Set(plugin_lang_get('cumulative') . ' ' . lang_get('by_date'));
$graph->title->SetFont($t_graph_font, FS_BOLD);
$graph->legend->Pos(0.05, 0.9, 'right', 'bottom');
$graph->legend->SetShadow(false);
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetFont($t_graph_font);
$graph->yaxis->scale->ticks->SetDirection(-1);
$graph->yaxis->SetFont($t_graph_font);
$graph->y2axis->SetFont($t_graph_font);
if (FF_FONT2 <= $t_graph_font) {
$graph->xaxis->SetLabelAngle(60);
} else {
$graph->xaxis->SetLabelAngle(90);
# can't rotate non truetype fonts
}
$graph->xaxis->SetLabelFormatCallback('graph_date_format');
$graph->xaxis->SetFont($t_graph_font);
$p1 = new LinePlot($reported_plot, $plot_date);
$p1->SetColor('blue');
$p1->SetCenter();
$p1->SetLegend(plugin_lang_get('legend_reported'));
$graph->AddY2($p1);
$p3 = new LinePlot($still_open_plot, $plot_date);
$p3->SetColor('red');
$p3->SetCenter();
$p3->SetLegend(plugin_lang_get('legend_still_open'));
$graph->Add($p3);
$p2 = new LinePlot($resolved_plot, $plot_date);
$p2->SetColor('black');
$p2->SetCenter();
$p2->SetLegend(plugin_lang_get('legend_resolved'));
$graph->AddY2($p2);
if (helper_show_query_count()) {
$graph->subtitle->Set(db_count_queries() . ' queries (' . db_time_queries() . 'sec)');
$graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
}
$graph->Stroke();
}
}
示例13:
$lineplot2->SetWeight(1);
// SET LINE THICKNESS
if ($xmarks == 1) {
$lineplot2->mark->SetType(MARK_X, 0.3);
// POINTS STYLE
$lineplot2->mark->SetColor("red");
// POINTS COLOUR
$lineplot2->mark->Show();
// SET THEM TO DISPLAY
}
$lineplot3->SetColor("blue");
// LINE COLOUR
$lineplot3->SetWeight(1);
// SET LINE THICKNESS
if ($xmarks == 1) {
$lineplot3->mark->SetType(MARK_X, 0.3);
// POINTS STYLE
$lineplot3->mark->SetColor("blue");
// POINTS COLOUR
$lineplot3->mark->Show();
// SET THEM TO DISPLAY
}
$lineplot->SetLegend("Light");
$lineplot2->SetLegend("Exp. Temp");
$lineplot3->SetLegend("Shl. Temp");
// Add the plot to the graph
$graph->Add($lineplot);
$graph->AddY2($lineplot2);
$graph->AddY2($lineplot3);
// Display the graph
$graph->Stroke();
示例14: LinePlot
$lineplot2->SetColor("blue");
$lineplot2->SetLegend($labels["NSTL10"]);
$lineplot2->SetWeight(2);
$graph->Add($lineplot2);
}
// Create the linear plot
if (sizeof($data["NSTLNSPR"]) > 1) {
$lineplot3 = new LinePlot($data["NSTLNSPR"], $times["NSTLNSPR"]);
$lineplot3->SetColor("black");
$lineplot3->SetLegend($labels["NSTLNSPR"]);
$lineplot3->SetWeight(2);
$graph->Add($lineplot3);
}
// Create the linear plot
if (sizeof($data["NSTL30FT"]) > 1) {
$lineplot4 = new LinePlot($data["NSTL30FT"], $times["NSTL30FT"]);
$lineplot4->SetColor("green");
$lineplot4->SetLegend($labels["NSTL30FT"]);
$lineplot4->SetWeight(2);
$graph->Add($lineplot4);
}
// Create the linear plot
if (sizeof($data["NSTL110"]) > 1) {
$lineplot5 = new LinePlot($data["NSTL110"], $times["NSTL110"]);
$lineplot5->SetColor("brown");
$lineplot5->SetLegend($labels["NSTL110"]);
$lineplot5->SetWeight(2);
$graph->Add($lineplot5);
}
// Display the graph
$graph->Stroke();
示例15: LinePlot
//$Threads_running[] = $rs_a[$i]['Threads_running'];
//Threads_cached
$p1 = new LinePlot($Threads_cached);
$p1->SetColor("blue");
$p1->SetCenter();
$p1->SetLegend("Cached AVG:{$Threads_cached_avg}");
$graph->Add($p1);
//Threads_connected
$p2 = new LinePlot($Threads_connected);
$p2->SetColor("red");
$p2->SetCenter();
$p2->SetLegend("Connected AVG:{$Threads_connected_avg}");
$graph->Add($p2);
//Threads_connected
//$p3 = new LinePlot($Threads_created);
//$p3->SetColor("orange");
//$p3->SetCenter();
//$p3->SetLegend("Threads_created AVG:$Threads_created_avg");
//$graph->Add($p3);
//Threads_connected
$p4 = new LinePlot($Threads_running);
$p4->SetColor("green");
$p4->SetCenter();
$p4->SetLegend("Running AVG:{$Threads_running_avg}");
$graph->Add($p4);
// Output line
$graph->Stroke();
?>