コード例 #1
0
ファイル: chart_pie.php プロジェクト: luyaotsung/framework
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setCaption("Expenditures Incurred in Publishing a Book");
     $chart->setDimensions(8, 6);
     $chart->setLabels(["Paper Cost", "Binding", "Printing Cost", "Royality", "Transportation Cost", "Promotion Cost"]);
     $chart->setPieValues([25, 20, 20, 15, 10, 10]);
     $this->addComponent($chart);
 }
コード例 #2
0
ファイル: chart_pie.php プロジェクト: sguha-work/examples
 public function buildDashboard()
 {
     $chart = new ChartComponent("pie_chart");
     $chart->setCaption("Monthly Unit Distribution");
     $chart->setDimensions(4, 4);
     $chart->setLabels(["Jan", "Feb", "Mar"]);
     $chart->setPieValues([10, 14, 13]);
     $this->addComponent($chart);
 }
コード例 #3
0
ファイル: motherboard.php プロジェクト: sguha-work/examples
 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);
 }
コード例 #4
0
 public function buildDashboard()
 {
     $this->setDashboardTitle("Genresman Dashboard");
     $form = new FormComponent('form1');
     $form->setCaption("Form Employees");
     $form->setDimensions(12, 3);
     $form->addDateRangeField('datebtw', 'Select Date', array("defaultStartDate" => "2014-04-23", "defaultEndDate" => "2014-05-01"));
     $this->addComponent($form);
     $dailySales = new ChartComponent('c1');
     $dailySales->setDimensions(7, 6);
     $dailySales->setCaption("Daily Sales");
     $dailySalesData = $this->getDailySales('2014-04-23', '2014-05-01');
     $dailySales->setYAxis("Revenue", array("numberHumanize" => true));
     $dailySales->addYAxis("covers", "Covers", array());
     $dailySales->setLabels(ArrayUtils::pluck($dailySalesData, "tarih2"));
     $dailySales->addSeries('food', "Food", ArrayUtils::pluck($dailySalesData, "cikis"));
     $dailySalesFoodData = $this->getDailySalesFood('2014-04-23', '2014-05-01');
     $dailySales->addSeries('covers', "Covers", ArrayUtils::pluck($dailySalesFoodData, "cikis"), array("yAxis" => "covers", "seriesDisplayType" => "line"));
     $this->addComponent($dailySales);
     $monthlySales = new ChartComponent('c2');
     $monthlySales->setDimensions(5, 6);
     $monthlySales->setCaption("Monthly Sales");
     $monthlySalesData = $this->getMonthlySales();
     $monthlySales->setYAxis("Revenue", array("numberHumanize" => true));
     $monthlySales->addYAxis("covers", "Covers", array());
     $monthlySales->setLabels(ArrayUtils::pluck($monthlySalesData, "ay"));
     $monthlySales->addSeries('food', "Food", ArrayUtils::pluck($monthlySalesData, "cikis"));
     $monthlySalesFood = $this->getMonthlySalesFood();
     $monthlySales->addSeries('covers', "Covers", ArrayUtils::pluck($monthlySalesFood, "cikis"), array("yAxis" => "food", "seriesDisplayType" => "line"));
     $this->addComponent($monthlySales);
     $item = new ChartComponent('c3');
     $item->setDimensions(7, 6);
     $item->setCaption("Item Categories");
     $item->setYAxis("", array("numberHumanize" => true));
     $itemCategories = $this->getItemCategories('2014-04-23', '2014-05-01');
     $item->setLabels(ArrayUtils::pluck($itemCategories, "grupadi"));
     $item->addSeries('items', "Items", ArrayUtils::pluck($itemCategories, "cikis"));
     $this->addComponent($item);
     $chart = new ChartComponent("pie_chart");
     $chart->setCaption("Clerk Sales");
     $chart->setDimensions(5, 6);
     $clerkData = $this->getClerkSales('2014-04-23', '2014-05-01');
     $chart->setLabels(ArrayUtils::pluck($clerkData, "garson"));
     $chart->setPieValues(ArrayUtils::pluck($clerkData, "cikis"), array("numberHumanize" => true));
     $this->addComponent($chart);
     $hour = new ChartComponent('c4');
     $hour->setDimensions(12, 6);
     $hour->setCaption("Hourly Sales");
     $hour->setYAxis("", array("numberHumanize" => true));
     $hourlySales = $this->getHourlySales('2014-04-23', '2014-05-01');
     $hour->setLabels(ArrayUtils::pluck($hourlySales, "SAAT"));
     $hour->addSeries('items', "Items", ArrayUtils::pluck($hourlySales, "CIKIS"));
     $this->addComponent($hour);
     $form->onApplyClick(array($dailySales, $item, $chart, $hour), "handleForm", $this);
 }