示例#1
3
$graph2->xgrid->Show();
$graph2->yaxis->SetLabelAngle(90);
$graph2->yaxis->SetColor('red');
$graph2->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->yaxis->SetLabelMargin(0);
$graph2->yaxis->scale->SetAutoMin(0);
$line2 = new Plot\LinePlot($data_windspeed, $xdata);
$line2->SetStepStyle();
$line2->SetColor('red');
$graph2->Add($line2);
//------------------------------------------------------------------
// Setup the wind temp graph
//------------------------------------------------------------------
$graph3 = new Graph\Graph(WIND_WIDTH - 30, WIND_HEIGHT);
$graph3->SetScale('datlin');
$graph3->Set90AndMargin(5, 20, 70, 30);
$graph3->SetMarginColor(BKG_COLOR);
$graph3->SetFrame(true, 'white', 0);
$graph3->SetBox();
$graph3->title->Set('Temperature');
$graph3->title->SetColor('black');
$graph3->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph3->title->SetMargin(5);
$graph3->xaxis->HideLabels();
$graph3->xgrid->Show();
$graph3->yaxis->SetLabelAngle(90);
$graph3->yaxis->SetColor('black');
$graph3->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph3->yaxis->SetLabelMargin(0);
$graph3->yaxis->scale->SetAutoMin(-10);
$line3 = new Plot\LinePlot($data_windtemp, $xdata);
示例#2
0
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph->xaxis->scale->SetDateFormat('h:i');
$graph->xgrid->Show();
$graph->yaxis->SetLabelAngle(90);
$graph->yaxis->SetColor('blue');
$graph->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph->yaxis->SetLabelMargin(0);
$graph->yaxis->scale->SetAutoMin(0);
$line = new Plot\LinePlot($data_winddirection, $xdata);
$line->SetStepStyle();
$line->SetColor('blue');
$graph->Add($line);
// Setup the wind speed graph
$graph2 = new Graph\Graph(WIND_WIDTH - 30, WIND_HEIGHT);
$graph2->SetScale('datlin');
$graph2->Set90AndMargin(5, 20, 60, 30);
$graph2->SetMarginColor(BKG_COLOR);
$graph2->SetFrame(true, 'white', 0);
$graph2->SetBox();
$graph2->title->Set('Windspeed');
$graph2->title->SetColor('red');
$graph2->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph2->title->SetMargin(5);
$graph2->xaxis->HideLabels();
$graph2->xgrid->Show();
$graph2->yaxis->SetLabelAngle(90);
$graph2->yaxis->SetColor('red');
$graph2->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->yaxis->SetLabelMargin(0);
$graph2->yaxis->scale->SetAutoMin(0);
$line2 = new Plot\LinePlot($data_windspeed, $xdata);
示例#3
0
<?php

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_scatter.php';
$datax = array(3.5, 3.7, 3, 4, 6.2, 6, 3.5, 8, 14, 8, 11.1, 13.7);
$datay = array(20, 22, 12, 13, 17, 20, 16, 19, 30, 31, 40, 43);
$graph = new Graph\Graph(300, 200);
$graph->SetScale("linlin");
$graph->Set90AndMargin(40, 40, 40, 40);
$graph->SetShadow();
$graph->title->Set("A 90 degrees rotated scatter plot");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Adjust the label align for X-axis so they look good rotated
$graph->xaxis->SetLabelAlign('right', 'center', 'right');
// Adjust the label align for Y-axis so they look good rotated
$graph->yaxis->SetLabelAlign('center', 'bottom');
$graph->xaxis->SetTitle('X-Axis title', 'low');
$graph->xaxis->title->SetAngle(90);
$graph->xaxis->title->SetMargin(15);
$sp1 = new ScatterPlot($datay, $datax);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(5);
$graph->Add($sp1);
$graph->Stroke();