Subversion Repositories Applications.annuaire

Rev

Rev 439 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 439 Rev 440
Line 16... Line 16...
16
	const GRAPH_CAMEMBERT = 'pie';
16
	const GRAPH_CAMEMBERT = 'pie';
17
	const GRAPH_COURBE = 'courbe';
17
	const GRAPH_COURBE = 'courbe';
18
	private $chemin_lib_graph = '';
18
	private $chemin_lib_graph = '';
Line 19... Line 19...
19
	
19
	
20
	public function __construct() {
-
 
21
		
20
	public function __construct() {
22
		$this->chemin_lib_graph = Config::get('chemin_jpgraph');
21
		$this->chemin_lib_graph = Config::get('chemin_jpgraph');
Line 23... Line 22...
23
	}
22
	}
24
 
23
 
Line 25... Line 24...
25
		public function genererGraphique($type_graphique, $valeurs, $titre = '', $taille = array(800, 800), $nom_axe_x = '', $nom_axe_y = '') {
24
	public function genererGraphique($type_graphique, $valeurs, $titre = '', $taille = array(800, 800), $nom_axe_x = '', $nom_axe_y = '') {
26
		include_once $this->chemin_lib_graph.'jpgraph.php';
25
		include_once $this->chemin_lib_graph.'jpgraph.php';
27
		
26
		
Line 42... Line 41...
42
 
41
 
43
	public function genererGraphiqueCamembert($valeurs, $titre, $taille) {
42
	public function genererGraphiqueCamembert($valeurs, $titre, $taille) {
44
		include_once $this->chemin_lib_graph.'jpgraph_pie.php';
43
		include_once $this->chemin_lib_graph.'jpgraph_pie.php';
45
		$legendes = array_keys($valeurs);
44
		$legendes = array_keys($valeurs);
46
		$valeurs = array_values($valeurs);
45
		$valeurs = array_values($valeurs);
47
		
46
 
48
		$oPie = new PiePlot($valeurs);
47
		$oPie = new PiePlot($valeurs);
49
		$oPie->SetLegends($legendes);
48
		$oPie->SetLegends($legendes);
50
		// position du graphique (légèrement à droite)
49
		// position du graphique (légèrement à droite)
51
		$oPie->SetCenter(0.35);
50
		$oPie->SetCenter(0.35);
Line 133... Line 132...
133
		$graph2->SetFrame(false);
132
		$graph2->SetFrame(false);
Line 134... Line 133...
134
		
133
		
135
		//$xpos3=3;$ypos3=1000;
134
		//$xpos3=3;$ypos3=1000;
136
		$mgraph->Add($graph1,$xpos1,$ypos1);
135
		$mgraph->Add($graph1,$xpos1,$ypos1);
137
		$mgraph->Add($graph2,$xpos2,$ypos2);
136
		$mgraph->Add($graph2,$xpos2,$ypos2);
138
		$mgraph->SetShadow();
137
		//$mgraph->SetShadow();
139
		//$mgraph->Add($graph['experience_bota'],$xpos3,$ypos3);
138
		//$mgraph->Add($graph['experience_bota'],$xpos3,$ypos3);
140
		return $mgraph;
139
		return $mgraph;
Line 141... Line 140...
141
	}
140
	}