示例#1
0
 public function buildDashboard()
 {
     $kpi = new KPIComponent('kpi');
     $kpi->setDimensions(4, 4);
     $kpi->setCaption('Downloads');
     $kpi->setValue(42);
     $kpi->bindToEvent("kpiClick", array($kpi), "handleKPIClick", $this);
     $this->addComponent($kpi);
 }
 public function buildDashboard()
 {
     $kpi = new KPIComponent("kpi1");
     $kpi->setCaption("Hello world");
     $kpi->setValue(42, array('valueTextColor' => 'red'));
     $kpi->setDimensions(4, 4);
     $kpi->bindToEvent("kpiClick", array($kpi), "handleKPIClick", $this);
     $this->addComponent($kpi);
 }
示例#3
0
 public function buildDashboard()
 {
     $kpi = new KPIComponent("kpi1");
     $kpi->setCaption("Hello world");
     $kpi->setValue(42);
     $kpi->setDimensions(4, 4);
     $kpi->setSparkValues(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'), array(20, 32, 34, 12, 4, 16));
     $kpi2 = new KPIComponent("kpi2");
     $kpi2->setCaption("Hello world");
     $kpi2->setValue(42);
     $kpi2->setDimensions(4, 4);
     $kpi2->setSparkValues(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'), array(20, 32, 34, 12, 4, 16));
     $this->log('KPI Object', "hello");
     $this->log('KPI', "I am a kpi object");
     $kpi->bindToEvent("kpiClick", array($kpi), "handleKPIClick", $this);
     $kpi2->bindToEvent("kpiClick", array($kpi2), "handleKPIClick2", $this);
     $this->addComponent($kpi);
     $this->addComponent($kpi2);
 }
示例#4
0
 public function buildDashboard()
 {
     $kpi1 = new KPIComponent('kpi1');
     $kpi1->setDimensions(3, 2);
     $kpi1->setCaption('Click Update');
     $kpi1->setValue(40);
     $kpi2 = new KPIComponent('kpi2');
     $kpi2->setDimensions(3, 2);
     $kpi2->setCaption('Click Remove');
     $kpi2->setValue(44);
     $kpi = new KPITableComponent('kpi');
     $kpi->setDimensions(4, 5);
     $kpi->setCaption('Sales by region 2013');
     $kpi->addKPI('first', array('caption' => 'Bangalore', 'value' => 2766, 'numberPrefix' => '$'));
     $kpi->addKPI('second', array('caption' => 'Chennai', 'value' => 1988, 'numberPrefix' => '$'));
     $kpi->addKPI('third', array('caption' => 'Delhi', 'value' => 1988, 'numberPrefix' => '$'));
     $kpi->setKPIValueColor('first', 'green');
     $kpi->setKPICaptionColor('second', 'red');
     $kpi1->bindToEvent('valueClick', array($kpi), 'handleUpdate', $this);
     $kpi2->bindToEvent('valueClick', array($kpi), 'handledelete', $this);
     $this->addComponent($kpi);
     $this->addComponent($kpi1);
     $this->addComponent($kpi2);
 }