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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| // Construction du conteneur
// Spécification largeur et hauteur
$graph2 = new Graph(400,250);
// Réprésentation linéaire
$graph2->SetScale("textlin");
// Ajouter une ombre au conteneur
$graph2->SetShadow();
// Fixer les marges
$graph2->img->SetMargin(40,30,25,40);
// Création du graphique histogramme
$bplot2 = new BarPlot($tableauQuantite);
// Spécification des couleurs des barres
$bplot2->SetFillColor(array('red', 'green', 'blue', 'orange'));
// Une ombre pour chaque barre
$bplot2->SetShadow();
// Afficher les valeurs pour chaque barre
$bplot2->value->Show();
// Fixer l'aspect de la police
$bplot2->value->SetFont(FF_ARIAL,FS_NORMAL,9);
// Modifier le rendu de chaque valeur
$bplot2->value->SetFormat('%d ventes');
// Ajouter les barres au conteneur
$graph2->Add($bplot2);
// Le titre
$graph2->title->Set("Nombre total de tickets par mois");
$graph2->title->SetFont(FF_FONT1,FS_BOLD);
// Titre pour l'axe horizontal(axe x) et vertical (axe y)
$graph2->xaxis->title->Set("Mois");
$graph2->yaxis->title->Set("nb Tickets");
$graph2->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph2->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Légende pour l'axe horizontal
$graph2->xaxis->SetTickLabels($tableauMois);
// Afficher le graphique
$graph2->Stroke();
// Construction du conteneur
// Spécification largeur et hauteur
$graph = new Graph(400,250);
// Réprésentation linéaire
$graph->SetScale("textlin");
// Ajouter une ombre au conteneur
$graph->SetShadow();
// Fixer les marges
$graph->img->SetMargin(40,30,25,40);
// Création du graphique histogramme
$bplot = new BarPlot($tableauQuantiteClotures);
// Spécification des couleurs des barres
$bplot->SetFillColor(array('red', 'green', 'blue', 'orange'));
// Une ombre pour chaque barre
$bplot->SetShadow();
// Afficher les valeurs pour chaque barre
$bplot->value->Show();
// Fixer l'aspect de la police
$bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
// Modifier le rendu de chaque valeur
$bplot->value->SetFormat('%d ventes');
// Ajouter les barres au conteneur
$graph->Add($bplot);
// Le titre
$graph->title->Set("Nombre de tickets cloturés par mois");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Titre pour l'axe horizontal(axe x) et vertical (axe y)
$graph->xaxis->title->Set("Mois");
$graph->yaxis->title->Set("nb Tickets");
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Légende pour l'axe horizontal
$graph->xaxis->SetTickLabels($tableauMoisClotures);
// Afficher le graphique
$graph->Stroke(); |
Partager