public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 3); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); $table->setRowDataSource('paginate', $this); $table->setNumberOfRows(40); $table->setRowsPerPage(7); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Regional Sales"); $table->setDimensions(4, 4); $table->setRowsPerPage(8); $table->addColumn('zone', "Zone"); $table->addColumn('name', "Store Name"); $table->addColumn('sale', "Sales Amount", array("dataType" => "number", "numberPrefix" => "\$ ", "textAlign" => "center")); $data = array(array("zone" => "North", "name" => "Northern Stores", "sale" => 4000), array("zone" => "South", "name" => "Southern Stores", "sale" => 4500)); $table->addMultipleRows($data); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Regional Sales"); $table->setDimensions(4, 4); $table->setRowsPerPage(8); $table->addColumn('zone', "Zone"); $table->addColumn('name', "Store Name"); $table->addColumn('sale', "Sales Amount"); $table->addSparkColumn('customer', "Customers"); $data = array(array("zone" => "North", "name" => "Northern Stores", "sale" => 4000, "customer" => array(5, 3, 4, 8)), array("zone" => "South", "name" => "Southern Stores", "sale" => 4500, "customer" => array(10, 6, 15, 8))); $table->addMultipleRows($data); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); for ($i = 0; $i < 10; $i++) { // Single Row $table->addRow(array('colA' => $i * 2, 'colB' => $i * 2 + 1)); } $table->cellConditionalFormat("colA", "value>300", array("cellBackgroundColor" => "#000", "cellTextColor" => "#fff")); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("List of Employees"); $table->setDimensions(6, 3); $table->addColumn('FirstName', "First Name"); $table->addColumn('LastName', "Last Name"); $table->addColumn('City', "City"); $table->addColumn('State', "State", array('textItalicFlag' => true)); $table->addColumn('Country', "Country"); $table->setRowDataSource('paginate', $this); $table->setNumberOfRows($this->getEmployeesCount()); $table->setRowsPerPage(2); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); for ($i = 0; $i < 10; $i++) { // Single Row $table->addRow(array('colA' => $i * 2, 'colB' => $i * 2 + 1)); } // Multiple Rows $rows = array(array('colA' => 111, 'colB' => 22), array('colA' => 222, 'colB' => 33), array('colA' => 333, 'colB' => 44)); $table->addMultipleRows($rows); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Movies & Ratings"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('rank', "Rank"); $table->addColumn('title', "Title"); $table->addColumn('rating', "Rating"); $table->addMultipleRows($this->rows); // Adding multiple rows at once $filter = new FormComponent('form'); $filter->setCaption('Filter'); $filter->setDimensions(5, 3); $filter->addSelectField('rating_filter', 'Rating Greater Than', array(5, 6, 7, 8, 9)); $filter->onApplyClick(array($table), 'handleApplyClick', $this); $this->addComponent($table); $this->addComponent($filter); }
public function buildDashboard() { $this->setDashboardTitle("Sales Dashboard"); $this->setActionPath("/static/transfer/build/tour/motherboard_action.php"); // $yearwise = new ChartComponent ('yearly_sales'); // $yearwise->setCaption ("Yearly Sales"); // $yearwise->setDimensions (6, 6); // $yearData = $this->get_year(); // $yearwise->setLabels(ArrayUtils::pluck($yearData, 'payment_year')); // $yearwise->setYAxis("Sales", array( // "numberHumanize" => true, // 'numberPrefix' => "$" // )); // $totalSalesArr = ArrayUtils::pluck($yearData, "total_amount"); // $yearwise->addSeries ("sales", "Sales", $totalSalesArr, array( // 'numberPrefix' => "$" // )); // $yearwise->addDrillStep("get_monthwise", $this); // $yearwise->addDrillStep("get_daywise", $this); // $totalSales = 0; // foreach ($totalSalesArr as $key => $value) { // $totalSales += $value; // } // $yearwise->addComponentKPI("sales", array( // "caption" => "Total Sales", // "value" => $totalSales, // "numberPrefix" => "$", // "numberHumanize" => true // )); // $yearwise->addComponentKPI("second", array( // "caption" => "Revenue", // "value" => $totalSales, // "numberPrefix" => "$", // "numberHumanize" => true // )); // $this->addComponent ($yearwise); $category = new ChartComponent('category'); $category->setCaption("Category wise Sales"); $category->setDimensions(6, 6); $categoryData = $this->get_category(); $quantityData = $this->get_units(); $category->setLabels(ArrayUtils::pluck($categoryData, 'CategoryName')); $category->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $totalSalesArr = ArrayUtils::pluck($categoryData, "total_amount"); $category->addSeries("sales", "Sales", $totalSalesArr, array('numberPrefix' => "\$")); $category->addYAxis('unitsAx', "Units in Inventory", array()); $totalUnitsArr = ArrayUtils::pluck($quantityData, "total_quantity"); $category->addSeries("units", "Units in Inventory", $totalUnitsArr, array("seriesDisplayType" => "line", "yAxis" => 'unitsAx')); $category->addDrillStep("get_prod", $this); $category->addComponentKPI("cost", array("caption" => "Total Sales", "value" => $this->get_cost_inventory(), "numberPrefix" => "\$")); $category->addComponentKPI("units", array("caption" => "Total Units in Inventory", "value" => $this->get_unit_inventory())); $this->addComponent($category); $chart = new ChartComponent("Customer_satisfaction"); $chart->setCaption("Customer Satisfaction"); $chart->setDimensions(6, 6); $chart->setLabels(["Very Unsatisfied", "UnSatisfied", "Neutral", "Satisfied", "Very Satisfied"]); $chart->setPieValues([4, 10, 25, 25, 36], array("numberSuffix" => "%")); $this->addComponent($chart); $table = new TableComponent('table'); $table->setCaption("Average Shipping Time"); $table->setDimensions(6, 6); $ship = $this->get_shipping(); $table->addColumn('country', 'Country'); $table->addColumn('avg_time', 'Average Time', array("textAlign" => "right")); $table->addMultipleRows($this->PolulateData($ship)); $table->setRowsPerPage(12); $this->addComponent($table); $goods = new ChartComponent('goods_sold'); $goods->setCaption("Cost of Goods Sold"); $goods->setDimensions(6, 6); $yearArr = $this->get_yearName(); $goods->setLabels(ArrayUtils::pluck($yearArr, 'payment_year')); $goods->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $goodsSoldData = $this->get_goodsSold(); foreach ($goodsSoldData as $key => $value) { $goods->addSeries($key, $key, ArrayUtils::pluck($value, "total_amount"), array('numberPrefix' => "\$", 'seriesStacked' => true)); } $this->addComponent($goods); }