Exemplo n.º 1
0
 public function buildDashboard()
 {
     $kpi = new KPIComponent('kpi');
     $kpi->setDimensions(4, 4);
     $kpi->setCaption('Downloads');
     $kpi->setValue(42);
     $kpi->valueConditionalFormat("value < 50", "green");
     $this->addComponent($kpi);
     $kpi1 = new KPIGroupComponent('kpi1');
     $kpi1->setDimensions(12, 2);
     $kpi1->setCaption('Sales by region 2013');
     $kpi1->addKPI('first', array('caption' => 'Bangalore', 'value' => 2766, 'numberPrefix' => '$'));
     $kpi1->addKPI('second', array('caption' => 'Chennai', 'value' => 1988, 'numberPrefix' => '$'));
     $kpi1->addKPI('third', array('caption' => 'Delhi', 'value' => 1988, 'numberHumanize' => true));
     $kpi1->valueConditionalFormat("value > 2000", "green");
     $kpi1->valueConditionalFormat("value <= 2000", "red");
     $kpi3 = new KPITableComponent('kpi3');
     $kpi3->setDimensions(4, 5);
     $kpi3->setCaption('Sales by region 2013');
     $kpi3->addKPI('first', array('caption' => 'Bangalore', 'value' => 2766, 'numberPrefix' => '$'));
     $kpi3->addKPI('second', array('caption' => 'Chennai', 'value' => 1988, 'numberPrefix' => '$'));
     $kpi3->addKPI('third', array('caption' => 'Delhi', 'value' => 1988, 'numberPrefix' => '$'));
     $kpi3->valueConditionalFormat("value == 1988", "green");
     $kpi3->valueConditionalFormat("value < 1988", "red");
     $this->addComponent($kpi1);
     $this->addComponent($kpi3);
 }
Exemplo n.º 2
0
 public function buildDashboard()
 {
     $kpi = new KPITableComponent('kpi');
     $kpi->setDimensions(4, 6);
     $kpi->setCaption('Food Units Available');
     $kpi->addKPI('grains_cereals', array('caption' => 'Grains/Cereals', 'value' => 308, 'numberSuffix' => ' units'));
     $kpi->addKPI('meat_poultry', array('caption' => 'Meat/Poultry', 'value' => 165, 'numberSuffix' => ' units'));
     $kpi->addKPI('produce', array('caption' => 'Produce', 'value' => 100, 'numberSuffix' => ' units'));
     $kpi->addKPI('seafood', array('caption' => 'Sea Food', 'value' => 701, 'numberSuffix' => ' units'));
     $this->addComponent($kpi);
 }
Exemplo n.º 3
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);
 }