Esempio n. 1
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);
 }
Esempio n. 2
0
 public function buildDashboard()
 {
     $kpi = new GaugeComponent("num_tickets_closed");
     $kpi->setDimensions(6, 4);
     $kpi->setCaption("# Closed/Total Tickets (24h)");
     $kpi->setLimits(0, 93);
     $kpi->setValue(33);
     $this->addComponent($kpi);
 }
Esempio n. 3
0
 public function buildDashboard()
 {
     $gauge = new GaugeComponent("gauge");
     $gauge->setDimensions(4, 3);
     $gauge->setCaption('Points');
     $gauge->setValue(144, array("numberPrefix" => '$'));
     $gauge->setLimits(0, 200);
     $this->addComponent($gauge);
 }
Esempio n. 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));
     $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);
 }
Esempio n. 5
0
$saleTable = new TableComponent();
$saleTable->setCaption("Sales Table");
$saleTable->setWidth(3);
$saleTable->setDataSource($dataSource);
$saleTable->addColumn("Track", "track.Name");
$saleTable->addColumn("Album", "album.Title");
$saleTable->addColumn("Sale Date", "invoice.InvoiceDate", array('width' => 50));
$saleTable->addColumn("Amount", "track.UnitPrice * invoiceLine.Quantity", array('width' => 50, 'textAlign' => 'right', 'numberPrefix' => '$'));
Dashboard::addComponent($saleTable);
// Link the artist chart to the sales table
$artistSales->autoLink($saleTable);
// Create a Key Performance Indicators to measure the total sales last month
$saleKPI = new KPIComponent();
$saleKPI->setCaption("Last Month's sales");
$saleKPI->setDataSource($dataSource);
$saleKPI->setValueExpression("track.UnitPrice * invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM", 'numberPrefix' => '$'));
$saleKPI->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'month'));
Dashboard::addComponent($saleKPI);
// Link the artist chart to sales KPI
$artistSales->autoLink($saleKPI);
$yearlySalesGauge = new GaugeComponent();
$yearlySalesGauge->setCaption("This Year's sales");
$yearlySalesGauge->setPlaceholder("Please select an artist");
$yearlySalesGauge->setDataSource($dataSource);
$yearlySalesGauge->setValueExpression("invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM"));
$yearlySalesGauge->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'year'));
$yearlySalesGauge->setKeyPoints(array(5, 10, 20, 30));
Dashboard::addComponent($yearlySalesGauge);
// Link the artist chart to the yearly sales gauge
$artistSales->autoLink($yearlySalesGauge);
Dashboard::Render();