本文整理汇总了PHP中LinePlot类的典型用法代码示例。如果您正苦于以下问题:PHP LinePlot类的具体用法?PHP LinePlot怎么用?PHP LinePlot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LinePlot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: lineChart
public static function lineChart($data1, $data2, $legends)
{
$graph = new Graph(600, 400);
$graph->SetScale('intlin');
$graph->SetShadow();
$graph->SetMargin(40, 20, 20, 40);
// $graph->title->Set('Calls per operator (June,July)');
// $graph->subtitle->Set('(March 12, 2008)');
// $graph->xaxis->title->Set('Operator');
// $graph->yaxis->title->Set('# of calls');
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetTickLabels($legends);
$lineplot = new LinePlot($data1);
$lineplot->SetWeight(4);
// Two pixel wide
// Add the plot to the graph
$graph->Add($lineplot);
// Create the second data series
$lineplot2 = new LinePlot($data2);
$lineplot2->SetWeight(4);
// Two pixel wide
$graph->Add($lineplot2);
$lineplot->SetLegend("This Year");
$lineplot2->SetLegend("Last Year");
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.4, 0.95, "center", "bottom");
return $graph->Stroke('../graph/compareLineChart.png');
}
开发者ID:RushanGajanayake,项目名称:ACTA_Project,代码行数:29,代码来源:graphs.php
示例2: monthchart
function monthchart($xdata, $ydata, $title = 'Line Chart')
{
// Create the graph. These two calls are always required
$graph = new Graph(600, 250, "auto", 60);
$graph->img->SetAntiAliasing(false);
$graph->SetScale("textlin");
$graph->xaxis->SetTickLabels($xdata);
$graph->xgrid->SetColor('#E3E3E3');
$graph->legend->SetFrameWeight(1);
// Setup title
$graph->title->Set($title);
foreach ($ydata as $item) {
// Create the linear plot
if (count($item['values']) != count($xdata)) {
continue;
}
$lineplot = new LinePlot($item['values'], $xdata);
$lineplot->SetColor($item['color']);
if (count($ydata) == 1) {
$lineplot->SetFillColor($item['color']);
}
// Add the plot to the graph
$graph->Add($lineplot);
$lineplot->SetLegend($item['legend']);
}
return $graph;
}
开发者ID:FaddliLWibowo,项目名称:MapIgniter,代码行数:27,代码来源:jpgraph.php
示例3: graficofecha
public function graficofecha($gestion)
{
if (Conectar::con()) {
//$gestion='2013';
$objetoanalisis = new classAnalisis();
$anio = $gestion;
for ($i = 0; $i < 12; $i++) {
$dat[] = $objetoanalisis->ventamensual($anio, $i);
}
$datos = $dat;
//$datos =array('1','4','3','3','5');
$grafico = new Graph(400, 300, "auto");
$grafico->SetScale("textlin");
$grafico->title->Set("Resumen de ventas por gestion");
$grafico->xaxis->title->Set("");
$grafico->yaxis->title->Set("");
// Un gradiente Horizontal de rojo a azul
// 25 pixeles de ancho para cada barra
$lineplot = new LinePlot($datos);
$lineplot->SetColor("green");
$lineplot->SetWeight(2);
$grafico->Add($lineplot);
return $grafico->Stroke();
}
}
开发者ID:jaironman3008,项目名称:mercadomundial,代码行数:25,代码来源:classgrafico.php
示例4: 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, '#[email protected]', '#[email protected]');
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;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:58,代码来源:GraphOnTrackersV5_Engine_CumulativeFlow.class.php
示例5: 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, '#[email protected]', '#[email protected]');
$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();
}
开发者ID:sdgdsffdsfff,项目名称:auth-center,代码行数:54,代码来源:Sites.php
示例6: Line
/**
*Funcion que crea graficas tipo Linea
*@param array() $data Array en el cual estan los datos para Y array(1, 2.3, 3, 4)
*@param string $legend Título de los datos de la línea
*@param string $color Color de la linea
*@param int $weight Grueso de la Linea
*/
function Line($data, $legend = null, $color = '#000000', $weight = 1)
{
vendor('jpgraph/jpgraph_line');
$line = new LinePlot($data);
$line->setLegend($legend);
$line->setColor($color);
$line->setWeight($weight);
#Adicion de linea a la grafica
$this->graph->Add($line);
if (strlen($legend) > $this->maxLength) {
$this->maxLength = strlen($legend);
}
}
开发者ID:boriscy,项目名称:upsys,代码行数:20,代码来源:jpgraph.php
示例7: process
function process()
{
parent::process();
$this->setPmvTitle($this->graph);
$this->setPmvBackgroundGradient($this->graph);
/**
* group (bar + line)
*/
$group = new PlotGroup();
$this->setPmvGroupProperties($group);
$group->axis->right->setColor(new Red());
$group->axis->right->label->setFont(new Font2());
/**
* line
*/
$plot = new LinePlot($this->y2, LINEPLOT_MIDDLE);
$plot->setColor(new Red());
$plot->setThickness(1);
$plot->setYAxis(PLOT_RIGHT);
$group->legend->add($plot, $this->y2Legend, LEGEND_MARK);
$group->add($plot);
/**
* vertical bar
*/
$plot = new BarPlot($this->y1);
$plot->grid->setType(LINE_DASHED);
$this->setPmvPadding($plot);
$this->setPmvBackgroundGradient($plot);
$this->setPmvBarBorderProperties($plot);
$this->setPmvBarShadowProperties($plot);
$this->setPmvLabelProperties($plot, $this->y1);
$this->setPmvBarGradient($plot);
$this->setPmvBarSize($plot);
//$plot->xAxis->setColor( new Color( 50, 97, 243) );
//$plot->yAxis->setColor( new Color( 50, 97, 243) );
//$plot->xAxis->label->setFont($this->font20);
$group->axis->bottom->setLabelText($this->x);
$group->axis->bottom->setPadding(0, 0, 100, 0);
// display one axis label on two because too long for Mar 04 Apr 04 etc.
if (isset($this->interval)) {
$group->axis->bottom->label->setInterval(2);
}
$group->legend->add($plot, $this->y1Legend, LEGEND_BACKGROUND);
$group->add($plot);
/**
* add group to graph
*/
$this->graph->add($group);
}
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:49,代码来源:GraphBarAndCurb.class.php
示例8: 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);
}
开发者ID:anggadjava,项目名称:mitra_siakad,代码行数:48,代码来源:pmblap.aplikan.cetak.php
示例9: linechart
function linechart($ydata, $title = 'Line Chart')
{
require_once APPPATH . 'third_party/jpgraph-3.5.0b1/src/jpgraph.php';
require_once APPPATH . 'third_party/jpgraph-3.5.0b1/src/jpgraph_line.php';
// Create the graph. These two calls are always required
$graph = new Graph(350, 250, "auto", 60);
$graph->SetScale("textlin");
// Setup title
$graph->title->Set($title);
// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
return $graph;
// does PHP5 return a reference automatically?
}
开发者ID:kpeet,项目名称:Brotec_system_repo,代码行数:17,代码来源:grafico.php
示例10: AudiogrammeTonal
function AudiogrammeTonal($with_legend = true)
{
$frequences = CExamAudio::$frequences;
$delta = $with_legend ? 75 : 0;
// Setup the graph.
$this->Graph(300 + $delta, 250, "auto");
$this->SetScale("textlin", -120, 10);
$this->SetMarginColor("lightblue");
// Image setup
//$this->img->SetAntiAliasing();
$this->img->SetMargin(45, 20 + $delta, 30, 15);
// Legend setup
if ($with_legend) {
$this->legend->Pos(0.02, 0.5, "right", "center");
$this->legend->SetShadow("[email protected]", 3);
$this->legend->SetFont(FF_ARIAL, FS_NORMAL, 7);
$this->legend->SetFillColor('[email protected]');
} else {
$this->legend->Hide();
}
// Title setup
$this->title->SetFont(FF_ARIAL, FS_NORMAL, 10);
$this->title->SetColor("darkred");
//Setup X-axis labels
$this->xgrid->Show(true);
$this->xgrid->SetColor("lightgray", "lightgray:1.8");
$this->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
$this->xaxis->SetTickLabels($frequences);
$this->xaxis->SetLabelSide(1);
$this->xaxis->SetLabelMargin(22);
// Setup Y-axis labels
$this->ygrid->Show(true, true);
$this->ygrid->SetColor("lightgray", "lightgray:1.8");
$this->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
$this->yaxis->SetLabelFormatString("%ddB");
$this->yaxis->scale->ticks->Set(20, 10);
$this->yaxis->scale->ticks->SupressZeroLabel(false);
$this->yaxis->scale->ticks->SupressMinorTickMarks(false);
// Empty plots for scale window
foreach ($frequences as $value) {
$datay[] = 100;
}
$p1 = new LinePlot($datay);
$p1->SetCenter();
$this->Add($p1);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:46,代码来源:inc_graph_audio_tonal.php
示例11: create
public function create()
{
$legend = $this->getArg('legend');
$y = $this->getArg('y');
if ($y === NULL) {
awImage::drawError("Class LightLinePattern: Argument 'y' must not be NULL.");
}
$plot = new LinePlot($y);
$plot->setSize(0.7, 1);
$plot->setCenter(0.35, 0.5);
$plot->setPadding(35, 15, 35, 30);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
$plot->grid->setType(Line::DASHED);
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->setFill(new MidRed());
$plot->mark->setSize(6);
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(Legend::LEFT);
$plot->legend->shadow->smooth(TRUE);
if ($legend !== NULL) {
$plot->legend->add($plot, $legend, Legend::MARK);
}
return $plot;
}
开发者ID:carriercomm,项目名称:jbs,代码行数:25,代码来源:LightLine.php
示例12: createSpline
function createSpline($ydata = "")
{
$xdata = array(2, 4, 6, 8, 10, 12, 14, 16);
if (!$ydata) {
$ydata = array(5, 1, 9, 6, 4, 3, 4, 2);
}
// Get the interpolated values by creating
// a new Spline object.
$spline = new Spline($xdata, $ydata);
// For the new data set we want 40 points to
// get a smooth curve.
list($newx, $newy) = $spline->Get(50);
// Create the graph
$g = new Graph(380, 300);
$g->SetMargin(30, 20, 40, 30);
//$g->title->Set("Natural cubic splines");
//$g->title->SetFont(FF_ARIAL,FS_NORMAL,12);
//$g->subtitle->Set('(Control points shown in red)');
//$g->subtitle->SetColor('darkred');
$g->SetMarginColor('lightblue');
//$g->img->SetAntiAliasing();
// We need a linlin scale since we provide both
// x and y coordinates for the data points.
$g->SetScale('linlin');
$xlable = array('', 'AA', 'AA', 'AB', 'AB', 'BB', 'BB', 'BC', 'BC', 'CC', 'CC', 'CD', 'CD', 'DD', 'DD', 'FF', 'FF', '');
// We want 1 decimal for the X-label
//$g -> xaxis -> SetLabelFormat('%d');
$g->xaxis->SetTickLabels($xlable);
// We use a scatterplot to illustrate the original
// contro points.
$splot = new ScatterPlot($ydata, $xdata);
//
$splot->mark->SetFillColor('[email protected]');
$splot->mark->SetColor('[email protected]');
// And a line plot to stroke the smooth curve we got
// from the original control points
$lplot = new LinePlot($newy, $newx);
$lplot->SetColor('navy');
// Add the plots to the graph and stroke
$g->Add($lplot);
$g->Add($splot);
$g->Stroke();
}
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:43,代码来源:spline.php
示例13: 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();
}
开发者ID:ztobs,项目名称:wsf,代码行数:42,代码来源:image.php
示例14: plot
function plot()
{
$this->_setValues();
$graph = new Graph(380, 250);
$graph->img->SetMargin(50, 30, 40, 40);
$graph->SetShadow();
$graph->SetColor("lightyellow");
$graph->SetScale("textlin");
$graph->title->Set($this->_graphTitle);
$graph->yaxis->SetColor("blue");
$graph->xaxis->SetColor("blue");
$graph->title->SetFont(FONT1_BOLD);
$graph->xaxis->SetTickLabels($this->_xaxisValues);
$lineplot = new LinePlot($this->_yaxisValues);
$lineplot->SetColor("red");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
}
开发者ID:Ethennoob,项目名称:Web,代码行数:20,代码来源:GraphPlotArticleYear.php
示例15: 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;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:26,代码来源:BurndownView.class.php
示例16: draw_artichow
/**
* Build a graph onto disk using Artichow library
*
* @param string $file Image file name to use if we save onto disk
* @param string $fileurl Url path to show image if saved onto disk
* @return void
*/
private function draw_artichow($file, $fileurl)
{
global $artichow_defaultfont;
dol_syslog(get_class($this) . "::draw_artichow this->type=" . join(',', $this->type));
if (!defined('SHADOW_RIGHT_TOP')) {
define('SHADOW_RIGHT_TOP', 3);
}
if (!defined('LEGEND_BACKGROUND')) {
define('LEGEND_BACKGROUND', 2);
}
if (!defined('LEGEND_LINE')) {
define('LEGEND_LINE', 1);
}
// Create graph
$classname = '';
if (!isset($this->type[0]) || $this->type[0] == 'bars') {
$classname = 'BarPlot';
} else {
if ($this->type[0] == 'lines') {
$classname = 'LinePlot';
} else {
$classname = 'TypeUnknown';
}
}
include_once ARTICHOW_PATH . $classname . '.class.php';
// Definition de couleurs
$bgcolor = new Color($this->bgcolor[0], $this->bgcolor[1], $this->bgcolor[2]);
$bgcolorgrid = new Color($this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]);
$colortrans = new Color(0, 0, 0, 100);
$colorsemitrans = new Color(255, 255, 255, 60);
$colorgradient = new LinearGradient(new Color(235, 235, 235), new Color(255, 255, 255), 0);
$colorwhite = new Color(255, 255, 255);
// Graph
$graph = new Graph($this->width, $this->height);
$graph->border->hide();
$graph->setAntiAliasing(true);
if (isset($this->title)) {
$graph->title->set($this->title);
//print $artichow_defaultfont;exit;
$graph->title->setFont(new $artichow_defaultfont(10));
}
if (is_array($this->bgcolor)) {
$graph->setBackgroundColor($bgcolor);
} else {
$graph->setBackgroundGradient($colorgradient);
}
$group = new PlotGroup();
//$group->setSpace(5, 5, 0, 0);
$paddleft = 50;
$paddright = 10;
$strl = dol_strlen(max(abs($this->MaxValue), abs($this->MinValue)));
if ($strl > 6) {
$paddleft += $strl * 4;
}
$group->setPadding($paddleft, $paddright);
// Width on left and right for Y axis values
$group->legend->setSpace(0);
$group->legend->setPadding(2, 2, 2, 2);
$group->legend->setPosition(NULL, 0.1);
$group->legend->setBackgroundColor($colorsemitrans);
if (is_array($this->bgcolorgrid)) {
$group->grid->setBackgroundColor($bgcolorgrid);
} else {
$group->grid->setBackgroundColor($colortrans);
}
if ($this->hideXGrid) {
$group->grid->hideVertical(true);
}
if ($this->hideYGrid) {
$group->grid->hideHorizontal(true);
}
// On boucle sur chaque lot de donnees
$legends = array();
$i = 0;
$nblot = count($this->data[0]) - 1;
while ($i < $nblot) {
$x = 0;
$values = array();
foreach ($this->data as $key => $valarray) {
$legends[$x] = $valarray[0];
$values[$x] = $valarray[$i + 1];
$x++;
}
// We fix unknown values to null
$newvalues = array();
foreach ($values as $val) {
$newvalues[] = is_numeric($val) ? $val : null;
}
if ($this->type[0] == 'bars') {
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
//.........这里部分代码省略.........
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:dolgraph.class.php
示例17: 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();
?>
开发者ID:Ethennoob,项目名称:Web,代码行数:18,代码来源:rotex4.php
示例18: LinePlot
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30, 50, 30, 30);
$graph->title->Set('Filled Y-grid');
$graph->yaxis->HideZeroLabel();
$graph->ygrid->SetFill(true, '#[email protected]', '#[email protected]');
$graph->xgrid->Show();
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Create the first line
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetLegend('Line 1');
$graph->Add($p1);
// Create the second line
$p2 = new LinePlot($datay2);
$p2->SetColor("red");
$p2->SetLegend('Line 2');
$graph->Add($p2);
// Create the third line
$p3 = new LinePlot($datay3);
$p3->SetColor("orange");
$p3->SetLegend('Line 3');
$graph->Add($p3);
$graph->legend->SetShadow('[email protected]', 5);
$graph->legend->SetPos(0.1, 0.1, 'right', 'top');
// Output line
$graph->Stroke();
?>
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:28,代码来源:filledgridex1.php
示例19: 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
示例20: pg_close
pg_close($coop);
include "../../../include/jpgraph/jpgraph.php";
include "../../../include/jpgraph/jpgraph_bar.php";
include "../../../include/jpgraph/jpgraph_line.php";
include "../../../include/network.php";
$nt = new NetworkTable("IACLIMATE");
$cities = $nt->table;
$graph = new Graph(600, 400, "example1");
$graph->SetScale("textlin", 0, 100);
$graph->img->SetMargin(40, 5, 35, 60);
$graph->xaxis->SetTickLabels($xdata);
$graph->xaxis->SetTextTickInterval(100);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTitle("Precip [inches]");
$graph->xaxis->SetTitleMargin(30);
$graph->yaxis->SetTitle("Cumulative Distribution (percent)");
$graph->title->Set($cities[$station]['name'] . " Precip Accumulation Probabilities");
$graph->subtitle->Set($subtitle);
$l1 = new LinePlot($ydata);
$l1->SetColor("blue");
$l1->SetWeight(2);
$l1->AddArea($hm, $hm, LP_AREA_FILLED, "lightred");
$l1->AddArea($h95, $h95, LP_AREA_FILLED, "lightred");
$l1->AddArea($h5, $h5, LP_AREA_FILLED, "lightred");
$txt = new Text("Diagnostics\n Min: {$lowVal} ({$lowYear})\n 95%: " . ($lowVal + $h95 * 0.01) . "\n~Mean: " . ($lowVal + $hm * 0.01) . "\n SD: {$stddev}\n 5%: " . ($lowVal + $h5 * 0.01) . "\n Max: {$hiVal} ({$hiYear})\n");
$txt->SetPos(0.71, 0.128);
$txt->SetFont(FF_FONT1, FS_NORMAL);
$txt->SetColor("blue");
$graph->Add($l1);
$graph->Add($txt);
$graph->Stroke();
开发者ID:raprasad,项目名称:iem,代码行数:31,代码来源:precip_cdf.php
注:本文中的LinePlot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论