WebSite-PHP Framework PHP
Mehrsprachig
Einfacher Ajax Modus
Kein HTML, kein JavaScript
URL Rewriting
Mails senden
Sitemap - RSS - Web service
Laden Sie WebSite-PHP FrameWork jetzt herunter
 


Loading
 


Tutorial Graphic

Tutorials

>

Tutorial Graphic




Um Graphic zu benutzen, müssen Sie zum Admin Interface vom Framework WebSite-PHP gehen.

Wenn Sie sich eingeloggt haben gehen Sie zum Menü Konfiguration -> Module Konfigurieren und aktivieren das Modul Graphic.


Tutorial 1 : Simple Chart
Datei: /pages/tutorials/graphic/graphic-01.php

<?php
class Graphic01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple Chart";
        
        
$this->render = new Chart("chart-01");
        
        
// init data
        
$array_chart_data = array();
        for (
$i=0$i 12$i++) {
            
$array_chart_data[] = array($irand(099));
        }
        
        
// set points of the graphic
        
$this->render->addPoints("Data"
                                
$array_chart_data);
    }
}
?>


Tutorial 2 : Chart with legend
Datei: /pages/tutorials/graphic/graphic-02.php

<?php
class Graphic02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Chart with legend";
        
        
$this->render = new Chart("chart-02");
        
        
// init data
        
$array_chart_data = array();
        
$array_chart_data2 = array();
        
$array_chart_data3 = array();
        for (
$i=0$i 12$i++) {
            
$array_chart_data[] = array($irand(099));
            
$array_chart_data2[] = array($irand(099));
            
$array_chart_data3[] = array($irand(099));
        }
        
        
// set points of the graphics
        
$this->render->addPoints("Data 1"
                                
$array_chart_data);
        
$this->render->addPoints("Data 2"
                                
$array_chart_data2);
        
$this->render->addPoints("Data 3"
                                
$array_chart_data3);
                                
        
// display legend
        
$this->render->setLegend();
    }
}
?>


Tutorial 3 : Chart with legend and advance properties
Datei: /pages/tutorials/graphic/graphic-03.php

<?php
class Graphic03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Chart with legend 
                            and advance properties"
;
        
        
$this->render = new Chart("chart-03");
        
        
// init data
        
$array_chart_data = array();
        
$array_chart_data2 = array();
        
$array_chart_data3 = array();
        for (
$i=0$i 12$i++) {
            
$date = ($i<10?"0".$i:$i)."/01/".date("Y")." 00:00:00";
            
$array_chart_data[] = array(strtotime($date), rand(099));
            
$array_chart_data2[] = array(strtotime($date), rand(099));
            
$array_chart_data3[] = array(strtotime($date), rand(099));
        }
        
        
// set points of the graphics
        
$this->render->addPoints("Data 1"
                                
$array_chart_data);
        
$this->render->addPoints("Data 2"
                                
$array_chart_data2);
        
$this->render->addPoints("Data 3"
                                
$array_chart_data3);
                                
        
// display legend
        
$this->render->setLegend();
        
        
// define X as date
        
$this->render->setXAxisDataType(Chart::DATA_TYPE_DATE);
        
        
// define Y axis max
        
$this->render->setYAxisMax(150);
        
        
// add mouse tracking
        
$this->render->trackingWithMouse();
    }
}
?>


Tutorial 4 : Chart with bars design
Datei: /pages/tutorials/graphic/graphic-04.php

<?php
class Graphic04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Chart with bars design";
        
        
$this->render = new Chart("chart-04");
        
        
// init data
        
$array_chart_data = array();
        
$array_chart_data2 = array();
        
$array_chart_data3 = array();
        for (
$i=0$i 12$i++) {
            
$array_chart_data[] = array($irand(6099));
            
$array_chart_data2[] = array($irand(3059));
            
$array_chart_data3[] = array($irand(1029));
        }
        
        
// set points of the graphics
        
$this->render->addPoints("Data 1"
                                
$array_chart_data,
                                
Chart::DESIGN_BARS);
        
$this->render->addPoints("Data 2"
                                
$array_chart_data2,
                                
Chart::DESIGN_BARS);
        
$this->render->addPoints("Data 3"
                                
$array_chart_data3,
                                
Chart::DESIGN_BARS);
                                
        
// display legend
        
$this->render->setLegend();
    }
}
?>


Tutorial 5 : Chart with other design
Datei: /pages/tutorials/graphic/graphic-05.php

<?php
class Graphic05 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Chart with other design";
        
        
$this->render = new Chart("chart-05");
        
        
// init data
        
$array_chart_data = array();
        
$array_chart_data2 = array();
        
$array_chart_data3 = array();
        for (
$i=0$i 12$i++) {
            
$array_chart_data[] = array($irand(099));
            
$array_chart_data2[] = array($irand(099));
            
$array_chart_data3[] = array($irand(099));
        }
        
        
// set points of the graphics
        
$this->render->addPoints("Data 1"
                                
$array_chart_data,
                                
Chart::DESIGN_LINES_POINTS_WITH_STEPS);
        
$this->render->addPoints("Data 2"
                                
$array_chart_data2,
                                
Chart::DESIGN_LINES_WITH_STEPS);
        
$this->render->addPoints("Data 3"
                                
$array_chart_data3,
                                
Chart::DESIGN_POINTS);
                                
        
// display legend
        
$this->render->setLegend();
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Start Dokumentation Herunterladen Schnellstart Tutorials Wiki Issue Tracker