Пример #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);
 }
Пример #2
0
 public function buildDashboard()
 {
     $chart = new ChartComponent("my_first_chart");
     $chart->setCaption("Expenses incurred on Food Consumption by Year");
     $chart->setDimensions(6, 6);
     $chart->setLabels(["2009", "2010", "2011"]);
     $chart->addSeries("beverages", "Beverages", [13552, 19126, 12150]);
     $chart->addSeries("packaged_foods", "Packaged Foods", [13152, 13126, 14150]);
     $chart->addComponentKPI("total_sales", array('caption' => "Total Sales", 'value' => 41332, 'numberPrefix' => "\$"));
     $chart->addComponentKPI("total_profit", array('caption' => "Total Profit", 'value' => 31215, 'numberPrefix' => "\$", 'numberHumanize' => true, 'numberDecimalPoints' => 0));
     $this->addComponent($chart);
 }
Пример #3
0
 public function buildDashboard()
 {
     $chart = new ChartComponent("my_first_chart");
     $chart->setCaption("Expenses incurred on Food Consumption by Year");
     $chart->setDimensions(6, 6);
     $chart->setLabels(["2009", "2010", "2011"]);
     $chart->addSeries("beverages", "Beverages", [1355, 1916, 1150]);
     $chart->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321]);
     $chart->addComponentKPI("first", array("caption" => "Quantity", "value" => 20));
     $chart->addComponentKPI("second", array("caption" => "Revenue", "value" => 4200000, "numberPrefix" => "\$", "numberHumanize" => true));
     $this->addComponent($chart);
 }
Пример #4
0
 public function buildDashboard()
 {
     $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->setDashboardTitle("Sales Dashboard");
     $this->addComponent($yearwise);
     $category = new ChartComponent('category');
     $category->setCaption("Category wise Sales");
     $category->setDimensions(6, 6);
     $categoryData = $this->get_category();
     $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' => "\$"));
     $this->addComponent($category);
     $table = new TableComponent('table');
     $table->setCaption("Average Shipping Time");
     $table->setDimensions(6, 4);
     $ship = $this->get_shipping();
     $table->addColumn('country', 'Country');
     $table->addColumn('avg_time', 'Average Time');
     $table->addMultipleRows($this->PolulateData($ship));
     $this->addComponent($table);
     $goods = new ChartComponent('goods_sold');
     $goods->setCaption("Cost of Goods Sold");
     $goods->setDimensions(12, 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);
 }
Пример #5
0
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setCaption("Sales - 2013 vs 2012");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"));
     $chart->addSeries("sales2013", "2013", array(22400, 24800, 21800, 21800, 24600, 27600, 26800, 27700, 23700, 25900, 26800, 24800));
     $chart->addSeries("sales2012", "2012", array(10000, 11500, 12500, 15000, 16000, 17600, 18800, 19700, 21700, 21900, 22900, 20800));
     $chart->setYAxis('Sales', array("numberPrefix" => '$', "numberHumanize" => true));
     $chart->addComponentKPI('beverages', array('caption' => 'Maximum sales in 2012', 'value' => 22900, 'numberPrefix' => '$', 'numberHumanize' => true));
     $chart->addComponentKPI('condiments', array('caption' => 'Lowest sales in 2012', 'value' => 10000, 'numberPrefix' => '$', 'numberHumanize' => true));
     $chart->addComponentKPI('confections', array('caption' => 'Maximum sales in 2013', 'value' => 27700, 'numberPrefix' => '$', 'numberHumanize' => true));
     $chart->addComponentKPI('daily_products', array('caption' => 'Lowest sales in 2013', 'value' => 21800, 'numberPrefix' => '$', 'numberHumanize' => true));
     $this->addComponent($chart);
 }
Пример #6
0
 public function buildDashboard()
 {
     $chart = new ChartComponent("Sales - 2013 v 2012");
     $chart->setCaption("Sales - 2013 v 2012");
     $chart->setDimensions(8, 6);
     $chart->setLabels(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]);
     $chart->addSeries("2013", "2013", [22400, 24800, 21800, 21800, 24600, 27600, 26800, 27700, 23700, 25900, 26800, 24800]);
     $chart->addSeries("2012", "2012", [10000, 11500, 12500, 15000, 16000, 17600, 18800, 19700, 21700, 21900, 22900, 20800]);
     $chart->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $chart->addComponentKPI('beverages', array('caption' => 'Beverages', 'value' => 559, 'numberSuffix' => ' units'));
     $chart->addComponentKPI('condiments', array('caption' => 'Condiments', 'value' => 507, 'numberSuffix' => ' units'));
     $chart->addComponentKPI('confections', array('caption' => 'Confections', 'value' => 386, 'numberSuffix' => ' units'));
     $chart->addComponentKPI('daily_products', array('caption' => 'Daily Products', 'value' => 393, 'numberSuffix' => ' units'));
     $this->addComponent($chart);
 }
Пример #7
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);
 }
Пример #8
0
 public function buildDashboard()
 {
     $chart = new ChartComponent("my_first_chart");
     $chart->setCaption("Expenses incurred on Food Consumption by Year");
     $chart->setDimensions(6, 6);
     $chart->setLabels(["2009", "2010", "2011"]);
     $chart->addSeries("beverages", "Beverages", [1355, 1916, 1150]);
     $chart->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321]);
     $chart->addComponentKPI("first", array("caption" => "Number Formatter", "value" => 4200000, "numberPrefix" => "\$", "numberHumanize" => true));
     $chart->addComponentKPI("second", array("caption" => "Long Text with blah blah blah", "value" => 200, "numberForceDecimals" => true));
     $chart->addComponentKPI("third", array("caption" => "new", "value" => 20, "numberSuffix" => "%"));
     $chart->addComponentKPI("forth", array("caption" => "again", "value" => 100));
     $chart2 = new ChartComponent("my_second_chart");
     $chart2->setCaption("Update Chart");
     $chart2->setDimensions(6, 6);
     $chart2->setLabels(["2009", "2010", "2011"]);
     $chart2->addSeries("beverages", "Beverages", [1355, 1916, 1150]);
     $chart2->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321]);
     $chart2->addComponentKPI("first", array("caption" => "Number Formatter", "value" => 4200000, "numberPrefix" => "\$", "numberHumanize" => true));
     $chart2->addComponentKPI("second", array("caption" => "Long Text with blah blah blah", "value" => 200, "numberForceDecimals" => true));
     $chart2->addComponentKPI("third", array("caption" => "new", "value" => 20, "numberSuffix" => "%"));
     $chart3 = new ChartComponent("my_third_chart");
     $chart3->setCaption("Update Chart");
     $chart3->setDimensions(6, 6);
     $chart3->setLabels(["2009", "2010", "2011"]);
     $chart3->addSeries("beverages", "Beverages", [1355, 1916, 1150]);
     $chart3->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321]);
     $chart3->addComponentKPI("first", array("caption" => "Number Formatter", "value" => 4200000, "numberPrefix" => "\$", "numberHumanize" => true));
     $chart3->addComponentKPI("second", array("caption" => "Long Text with blah blah blah", "value" => 200, "numberForceDecimals" => true));
     $chart3->addComponentKPI("third", array("caption" => "new", "value" => 20, "numberSuffix" => "%"));
     $chart2->onItemClick(array($chart2), 'handleClick', $this);
     $chart3->onItemClick(array($chart3), 'handleClickRemove', $this);
     $this->addComponent($chart);
     $this->addComponent($chart2);
     $this->addComponent($chart3);
 }
Пример #9
0
 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);
 }