- Kód: Vybrat vše
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');
require_once( "jpgraph/jpgraph_date.php" );
$datay1 = $temp;
// Setup the graph
$graph = new Graph(800,400);
$graph->SetScale("textlin");
//$graph->SetScale('datint');
$theme_class=new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Graf teploty');
$graph->SetBox(false);
$graph->img->SetAntiAliasing();
$graph->img->SetImgFormat('png');
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xgrid->Show();
$graph->xgrid->SetLineStyle("solid");
$graph->xaxis->SetTickLabels($cas);
$graph->xaxis->SetLabelAngle(90);
$graph->xgrid->SetColor('#E3E3E3');
$graph->xaxis->SetTextLabelInterval(6);
$graph->xaxis->HideTicks(false,false);
//$graph->yaxis->SetLabelFormatString('H:i');
//$graph->xaxis->scale->SetDateFormat('H:i');
// Create the first line
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("red");
$p1->SetWeight(5);
//$p1->SetLegend('Line 1');
//$graph->legend->SetFrameWeight(1);
// Output line
$graph->Stroke("jpg_grafy/teplota.png");
Předem děkuji za radu.