示例#1
0
$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 LinePlot($data_windtemp, $xdata);
$line3->SetStepStyle();
$line3->SetColor('black');
$graph3->Add($line3);
//-----------------------
// Create a multigraph
//----------------------
$mgraph = new MGraph();
$mgraph->SetMargin(2, 2, 2, 2);
$mgraph->SetFrame(true, 'darkgray', 2);
$mgraph->SetFillColor(BKG_COLOR);
$mgraph->Add($graph, 0, 50);
$mgraph->Add($graph2, 250, 50);
$mgraph->Add($graph3, 460, 50);
$mgraph->title->Set('Climate diagram 12 March 2009');
$mgraph->title->SetFont(FF_ARIAL, FS_BOLD, 20);
$mgraph->title->SetMargin(8);
$mgraph->Stroke();
示例#2
0
// Setup the wind speed graph
$graph2 = new Graph(300, 800);
$graph2->SetScale('datlin');
$graph2->Set90AndMargin(50, 30, 60, 30);
$graph2->SetMarginColor('lightgray:1.7');
$graph2->SetFrame(true, 'white', 0);
$graph2->SetBox();
$graph2->title->Set('Windspeed');
$graph2->title->SetFont(FF_ARIAL, FS_BOLD, 14);
$graph2->title->SetMargin(10);
$graph2->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->xaxis->scale->SetDateFormat('h:i');
$graph2->xgrid->Show();
$graph2->yaxis->SetLabelAngle(45);
$graph2->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph2->yaxis->SetLabelMargin(0);
$graph2->yaxis->scale->SetAutoMin(0);
$line2 = new LinePlot($data_windspeed, $xdata);
$line2->SetStepStyle();
$line2->SetColor('red');
$graph2->Add($line2);
//-----------------------
// Create a multigraph
//----------------------
$mgraph = new MGraph();
$mgraph->SetMargin(2, 2, 2, 2);
$mgraph->SetFrame(true, 'darkgray', 2);
$mgraph->SetFillColor('lightgray');
$mgraph->Add($graph);
$mgraph->Add($graph2, 300, 0);
$mgraph->Stroke();