Commit 44a425e38a4424f9e08b7b8b790b34b73fdeec0a

Authored by Guillaume
1 parent 7d660701

Test Graphe

Showing 1 changed file with 10 additions and 3 deletions   Show diff stats
site/graphe.php
... ... @@ -4,8 +4,15 @@ require_once ('jpgraph/jpgraph_line.php');
4 4 require_once('accesBase.php');
5 5  
6 6 $history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']);
7   -$datay = makeArray($history, "value");
8   -$dates = makeArray($history, "date");
  7 +$y = makeArray($history, "value");
  8 +$x = makeArray($history, "date");
  9 +str_replace(" ", "\n", $datax);
  10 +
  11 +for(int i=0; i<count($y); i++)
  12 +{
  13 + $datay[] = $y[count($y)-i-1];
  14 + $datax[] = $x[count($y)-i-1];
  15 +}
9 16  
10 17 // Setup the graph
11 18 $graph = new Graph(800,400);
... ... @@ -28,7 +35,7 @@ $graph-&gt;yaxis-&gt;HideTicks(false,false);
28 35  
29 36 $graph->xgrid->Show();
30 37 $graph->xgrid->SetLineStyle("solid");
31   -$graph->xaxis->SetTickLabels($dates);
  38 +$graph->xaxis->SetTickLabels($datax);
32 39 $graph->xgrid->SetColor('#E3E3E3');
33 40  
34 41 // Create the first line
... ...