예제 #1
0
 public function buildDashboard()
 {
     $this->setDashboardTitle("Stock Dashboard");
     $this->setActionPath("/static/transfer/build/tour/motherboard_stock_action.php");
     $kpi = new KPIGroupComponent('kpi');
     $kpi->setDimensions(12, 2);
     $kpi->setCaption('Units stock by Category');
     $Units = $this->get_units(true);
     foreach ($Units as $key => $value) {
         $kpi->addKPI($value['id'], array('caption' => $value['CategoryName'], 'value' => $value['Quantity'], 'numberSuffix' => ' units', 'numberHumanize' => true));
     }
     $this->addComponent($kpi);
     $table = new TableComponent('table');
     $table->setCaption("List of Item in Stock");
     $table->setDimensions(6, 5);
     $stock = $this->get_stock();
     $table->addColumn('id', 'Product Id');
     $table->addColumn('name', 'Product Name');
     $table->addColumn('category', 'Category');
     $table->addColumn('price', 'Price', array("numberPrefix" => "\$", "dataType" => "number"));
     $table->addColumn('stock', 'Stock');
     $table->addMultipleRows($this->PolulateData($stock));
     $this->addComponent($table);
     $c12 = new FormComponent('filter');
     $c12->setDimensions(6, 5);
     $c12->setCaption('Filter items in stock');
     $category = $this->get_category();
     $c12->addSelectField('category', 'Select Category', array_merge(['no selection'], ArrayUtils::pluck($category, 'CategoryName')));
     $c12->addTextField('contains', 'Product Name Contains');
     $c12->addNumericRangeField('stock', 'Units In Stock', array(0, 100));
     $this->addComponent($c12);
     $c12->onApplyClick(array($table), 'handleApply', $this);
 }
예제 #2
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);
 }
예제 #3
0
 public function buildDashboard()
 {
     $kpi = new KPIGroupComponent('kpi');
     $kpi->setDimensions(12, 2);
     $kpi->setCaption('Food Units Available');
     $kpi->addKPI('beverages', array('caption' => 'Beverages', 'value' => 559, 'numberSuffix' => ' units'));
     $kpi->addKPI('condiments', array('caption' => 'Condiments', 'value' => 507, 'numberSuffix' => ' units'));
     $kpi->addKPI('confections', array('caption' => 'Confections', 'value' => 386, 'numberSuffix' => ' units'));
     $kpi->addKPI('daily_products', array('caption' => 'Daily Products', 'value' => 393, 'numberSuffix' => ' units'));
     $this->addComponent($kpi);
 }
예제 #4
0
 public function buildDashboard()
 {
     $quarterlySales = new ChartComponent('quarterlySales');
     $quarterlySales->setDimensions(6, 6);
     $quarterlySales->setCaption("Quarterly Sales");
     $quarterlySales->setLabels(array("Q1", "Q2", "Q3", "Q4"));
     $quarterlySales->addYAxis('quantity', "Quantity");
     $quarterlySales->addSeries('sales', "Sales", array(13122, 41312, 46132, 51135), array('numberPrefix' => "\$"));
     $quarterlySales->addSeries('quantity', "Quantity", array(121, 392, 420, 489), array('yAxis' => 'quantity'));
     $quarterlySales->addComponentKPI('beverage', array('caption' => 'Beverages', 'value' => 22900, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('vegetable', array('caption' => 'Vegetables', 'value' => 10401, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('dairy', array('caption' => 'Dairy', 'value' => 27700, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $this->addComponent($quarterlySales);
     $numTickets = new KPIComponent('numTickets');
     $numTickets->setDimensions(3, 3);
     $numTickets->setCaption("Open Support Tickets");
     $numTickets->setValue(42);
     $this->addComponent($numTickets);
     $satisfactionGauge = new GaugeComponent('satisfactionGauge');
     $satisfactionGauge->setDimensions(3, 3);
     $satisfactionGauge->setCaption('Customer Satisfaction');
     $satisfactionGauge->setValue(8);
     $satisfactionGauge->setLimits(0, 10);
     $this->addComponent($satisfactionGauge);
     $ticketPriorities = new KPIGroupComponent('ticketPriorities');
     $ticketPriorities->setDimensions(6, 3);
     $ticketPriorities->setCaption('Ticket Priorities');
     $ticketPriorities->addKPI('high', array('caption' => 'High Priority', 'value' => 6));
     $ticketPriorities->addKPI('normal', array('caption' => 'Normal Priority', 'value' => 36));
     $this->addComponent($ticketPriorities);
 }
예제 #5
0
 public function buildDashboard()
 {
     // $kpi1 = new KPIGroupComponent('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 KPIGroupComponent('kpi');
     $kpi->setDimensions(12, 2);
     $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, 'numberHumanize' => true));
     $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);
 }
예제 #6
0
 public function buildDashboard()
 {
     $quarterlySales = new ChartComponent('quarterlySales');
     $quarterlySales->setDimensions(6, 6);
     $quarterlySales->setCaption("Quarterly Sales");
     $quarterlySales->setLabels(array("Q1", "Q2", "Q3", "Q4"));
     $quarterlySales->addYAxis('quantity', "Quantity");
     $quarterlySales->addSeries('sales', "Sales", array(13122, 41312, 46132, 51135), array('numberPrefix' => "\$"));
     $quarterlySales->addSeries('quantity', "Quantity", array(121, 392, 420, 489), array('yAxis' => 'quantity'));
     $quarterlySales->addComponentKPI('beverage', array('caption' => 'Beverages', 'value' => 22900, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('vegetable', array('caption' => 'Vegetables', 'value' => 10401, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('dairy', array('caption' => 'Dairy', 'value' => 27700, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addDrillStep('drillIntoMonths', $this);
     $this->addComponent($quarterlySales);
     $numTickets = new KPIComponent('numTickets');
     $numTickets->setDimensions(3, 3);
     $numTickets->setCaption("Open Support Tickets");
     $numTickets->setValue(42);
     $this->addComponent($numTickets);
     $satisfactionGauge = new GaugeComponent('satisfactionGauge');
     $satisfactionGauge->setDimensions(3, 3);
     $satisfactionGauge->setCaption('Customer Satisfaction');
     $satisfactionGauge->setValue(8);
     $satisfactionGauge->setLimits(0, 10);
     $this->addComponent($satisfactionGauge);
     $ticketPriorities = new KPIGroupComponent('ticketPriorities');
     $ticketPriorities->setDimensions(6, 3);
     $ticketPriorities->setCaption('Ticket Priorities');
     $ticketPriorities->addKPI('high', array('caption' => 'High Priority', 'value' => 6));
     $ticketPriorities->addKPI('normal', array('caption' => 'Normal Priority', 'value' => 36));
     $this->addComponent($ticketPriorities);
     $productsTable = new TableComponent('productsTable');
     $productsTable->setDimensions(6, 6);
     $productsTable->setCaption('Products');
     $productsTable->addColumn('name', 'Name');
     $productsTable->addColumn('category', 'Category');
     $productsTable->addColumn('price', 'Price', array('dataType' => "number", 'numberPrefix' => "\$", 'textAlign' => "right", 'numberForceDecimals' => true));
     $productsTable->addMultipleRows($this->tableData);
     $this->addComponent($productsTable);
     $productFilterForm = new FormComponent('productFilterForm');
     $productFilterForm->setDimensions(6, 6);
     $productFilterForm->setCaption('Filter Products');
     $productFilterForm->addMultiSelectField('category', 'Select Category', array('Vegetables', 'Dairy', 'Beverages'));
     $productFilterForm->addTextField('name', 'Product Name Contains');
     $productFilterForm->addNumericRangeField('price', 'Price', array(5, 20));
     $this->addComponent($productFilterForm);
     $productFilterForm->onApplyClick(array($productsTable), 'handleApplyClick', $this);
 }