1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<?php
extract($_POST);
include ("fonctions.php"); // Appel des fonctions 'connexion_bdd' et 'entete'.
// Inclusion de la librairie JPGraph
include("C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\my portable files\Cyclam\jpgraph\jpgraph.php");
include("C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\my portable files\Cyclam\jpgraph\jpgraph_line.php");
$connexion=connexion_bdd();//Connexion à la base de donnée à partir de la fonction.
//Initialisation du graph
$graph = new Graph(300,250);
$graph->SetScale("textlin");
$Pression = array(14,12,9,12);
$Temperature = array(12,45,45,14);
$PuissAbs = array(2,14,25,65);
$Vitesse= array (4,2,5,6);
$theme_class=new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Filled Y-grid');
$graph->SetBox(false);
$graph->img->SetAntiAliasing();
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xgrid->Show();
$graph->xgrid->SetLineStyle("solid");
$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->xgrid->SetColor('#E3E3E3');
//Création de la première Ligne
$p1 = new LinePlot($Pression);
$graph->Add($p1);
$p1->SetColor("#6495ED");
$p1->SetLegend('Line 1');
//Creation de la seconde Ligne
$p2 = new LinePlot($Temperature);
$graph->Add($p2);
$p2->SetColor("#B22222");
$p2->SetLegend('Line 2');
// Création de la troisième Ligne
$p3 = new LinePlot($PuissAbs);
$graph->Add($p3);
$p3->SetColor("#FF1493");
$p3->SetLegend('Line 3');
//Création de la quatrième Ligne
$p4 = new LinePlot($Vitesse);
$graph->Add($p4);
$p4->SetColor("#FF1493");
$p4->SetLegend('Line 4');
$graph->legend->SetFrameWeight(1);
// Affichage du graphe
$graph->Stroke();
?> |
Partager