Push();
#
$graph = new Graph(700,310,"auto");
$graph->img->SetMargin(40,40,30,60);
$graph->SetBox($aDrawPlotFrame=true, $aPlotFrameColor=array(100,100,100), $aPlotFrameWeight=1);
$graph->SetBackgroundGradient($aFrom=array(61,104,123), $aTo=array(250,255,255), $aGradType=GRAD_MIDHOR, $aStyle=BGRAD_FRAME);
//$graph->SetBackgroundImage("ship2.png",2);
// Adjust brightness and contrast for background image
// must be between -1 <= x <= 1, (0,0)=original image
//$graph->AdjBackgroundImage(0.5,-0.8);
//$graph->img->SetAntiAliasing();
// Use auto Date graph with integer steps
$graph->SetScale("datint");
// Set X-Axis date format to DD-MON
$graph->xaxis->scale->SetDateFormat("d-M");
$graph->xgrid->Show();
$graph->xgrid->SetLineStyle('dashed');
// Set the angle for the x-axis labels to 90 degrees
$graph->xaxis->SetLabelAngle(90);
// Set labels to start on 1st of the Month
$graph->xaxis->scale->SetTimeAlign( MONTHADJ_1 );
// Set date labels at the bottom
$graph->xaxis->SetPos('min');
$graph->SetShadow();
$graph->SetTitleBackground($aBackColor='darkslateblue',$aStyle=TITLEBKG_STYLE3, $aFrameStyle=TITLEBKG_FRAME_BOTTOM,$aFrameColor='black', $aFrameWeight=1, $aBevelHeight=3,$aEnable=true);
$graph->title->Set($intervall);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->title->SetColor('yellow');
//graph->xaxis->title->Set('Datum');
$graph->yaxis->title->Set('Celsius');
$graph->footer->right-> SetColor("aqua");
$graph->footer->right->Set('Timer (ms): ');
$graph->footer->right->SetFont(FF_COURIER,FS_ITALIC);
$graph->footer->SetTimer($timer);
// Adjust the legend position
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetPos(0.01,0.001,"right","top");
// Add 5% grace to top and bottom of plot
$graph->yscale->SetGrace(5,5);
#
# Now plot data
#
$p1 = new LinePlot($valMax, $title);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(1);
$p1->SetColor("red");
$p1->SetLegend($max1.'ºC');
//$p1->SetCenter();
$graph->Add($p1);
$p2 = new LinePlot($valMin, $title);
$p2->mark->SetType(MARK_FILLEDCIRCLE);
$p2->mark->SetFillColor("aqua");
$p2->mark->SetWidth(1);
$p2->SetColor("blue");
$p2->SetLegend($min1.'ºC');
//$p2->SetCenter();
$graph->Add($p2);
$p3 = new LinePlot($valAvg, $title);
//$p3->mark->SetType(MARK_FILLEDCIRCLE);
//$p3->mark->SetFillColor("red");
//$p3->mark->SetWidth(4);
$p3->SetColor("green");
$p3->SetLegend('Avg');
//$p3->SetCenter();
$graph->Add($p3);
// render the graph
@unlink("graph.png");
$graph->Stroke("graph.png");
echo ('
');
echo "
again
";
?>