To use Graphic, you need to connect to the admin interface of the framework WebSite-PHP. Once connected you will go to the menu Configuration -> Configure modules and enable the module Graphic. File: /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($i, rand(60, 99)); $array_chart_data2[] = array($i, rand(30, 59)); $array_chart_data3[] = array($i, rand(10, 29)); } // 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(); } } ?>
Go back to tutorial of the componant Graphic
|