diff --git a/site/graphe.php b/site/graphe.php index d67d634..d750672 100644 --- a/site/graphe.php +++ b/site/graphe.php @@ -3,8 +3,9 @@ require_once ('jpgraph/jpgraph.php'); require_once ('jpgraph/jpgraph_line.php'); require_once('accesBase.php'); -$history1 = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']); -$datay1 = makeArray($history1, "value"); +$history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']); +$datay1 = makeArray($history, "value"); +$absc = makeArray($history, "date"); //$history2 = getHistory('Atmos', '', '', '2020-01-02 00:00:00', '2020-04-05 23:59:59', 4); //$datay2 = makeArray($history2, "value"); @@ -37,26 +38,14 @@ $graph->yaxis->HideTicks(false,false); $graph->xgrid->Show(); $graph->xgrid->SetLineStyle("solid"); -$graph->xaxis->SetTickLabels(array('A','B','C','D')); +$graph->xaxis->SetTickLabels($absc); $graph->xgrid->SetColor('#E3E3E3'); // Create the first line -$p1 = new LinePlot($datay1); -$graph->Add($p1); -$p1->SetColor("#6495ED"); -$p1->SetLegend('Line 1'); - -// Create the second line -//$p2 = new LinePlot($datay2); -//$graph->Add($p2); -//$p2->SetColor("#B22222"); -//$p2->SetLegend('Line 2'); - -// Create the third line -//$p3 = new LinePlot($datay3); -//$graph->Add($p3); -//$p3->SetColor("#FF1493"); -//$p3->SetLegend('Line 3'); +$p = new LinePlot($datay); +$graph->Add($p); +$p->SetColor("#6495ED"); +$p->SetLegend('Line 1'); $graph->legend->SetFrameWeight(1); -- libgit2 0.21.2