Bonjour,
j'aimerai afficher la legende sur mon graphe réalisé à l'aide de Jpgraph mais j'ai une erreur au niveau de la ligne 58
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 $sqlb1 = "SELECT count(*) AS Number FROM base1 where col9='cloturé' and col3='Besancon'"; $sqlb2 = "SELECT count(*) AS Number FROM base1 where col9='fait' and col3='Besancon'"; $sqlb3 = "SELECT count(*) AS Number FROM base1 where col9='pas encore' and col3='Besancon'"; $sqlb4 = "SELECT count(*) AS Number FROM base1 where col9='programmé' and col3='Besancon'"; $sqlb5 = "SELECT count(*) AS Number FROM base1 where col9='' and col3='Besancon'"; $total = mysql_query($sqlTotal); $men1 = mysql_query($sqlb1); $men2 = mysql_query($sqlb2); $men3 = mysql_query($sqlb3); $men4 = mysql_query($sqlb4); $men5 = mysql_query($sqlb5); while($resultTotal = mysql_fetch_array($total)) { $totalValue = $resultTotal['Number']; } while($resultmen1 = mysql_fetch_array($men1)) { $men1value = $resultmen1['Number']; } while($resultmen2 = mysql_fetch_array($men2)) { $men2value = $resultmen2['Number']; } while($resultmen3 = mysql_fetch_array($men3)) { $men3value = $resultmen3['Number']; } while($resultmen4 = mysql_fetch_array($men4)) { $men4value = $resultmen4['Number']; } while($resultmen5 = mysql_fetch_array($men5)) { $men5value = $resultmen5['Number']; } $data = array($men1value, $men2value, $men3value, $men4value, $men5value ); $graph = new PieGraph(410, 310,"auto"); $graph->SetShadow(); $graph->title->Set("Besançon"); $graph->title->SetFont(FF_FONT1,FS_BOLD); $p1 = new PiePlot3D($data); $p1->SetSize(.3); $p1->SetCenter(0.45); $p1->SetStartAngle(300); $p1->SetAngle(45); $p1->SetTheme('earth'); $p1->value->SetFont(FF_FONT1,FS_BOLD); $p1->SetLabelType(PIE_VALUE_PER); $p1 = new PiePlot3D($data); $p1->SetSize(0.4); $p1->SetCenter(0.45); $graph->Add($p1); @unlink('graph.jpg'); $graph->SetLabels($tableaulegend); $graph->Stroke("graph.jpg"); //echo '<img src="graph.jpg?'. rand().'" alt =""/>'; echo '<img src="graph.jpg?'. urlencode(date(DATE_ATOM)).'" alt =""/>';
Partager