コード例 #1
0
ファイル: MesGraphs.php プロジェクト: amstr4d/Cinepassion
 function __construct($Data, $Legende, $TypeInfos = GRAPH_PIEPLOT_TYPEINFOS)
 {
     parent::__construct($Data);
     $this->SetTheme(GRAPH_THEME);
     // Définition du thème du graphe grâce à la constante GRAPH_THEME
     $this->SetCenter(0.5, 0.4);
     // Centré à 50% par rapport à la largeur de la zone du graphe et à 40% par rapport à la hauteur de la zone du graphe
     $this->SetSize(120);
     // Le graphe fait 120px de large
     $this->SetAngle(45);
     // Angle du graphe
     $this->ExplodeSlice(0, 0);
     // Sortir le premier camembert (n°0) de 0 pixels
     // Mise en forme des données du graphe
     $this->value->SetFont(FF_TIMES, FS_BOLD, 10);
     $this->value->SetColor("#404040;");
     // Affichage des pourcentages ou des valeurs fixes
     if ($TypeInfos == "Pourcentage") {
         $this->SetLabelType(PIE_VALUE_PER);
         // valeur par défaut
     } else {
         $this->SetLabelType(PIE_VALUE_ABS);
         $this->value->SetFormat('%d pers');
         $this->value->Show();
     }
     // Légende du graphe
     $this->SetLegends($Legende);
 }