public function buildDashboard()
 {
     $labels = [];
     $data = [];
     $data2 = [];
     for ($i = -1; ++$i < 30;) {
         $labels[$i] = $i + 1 . ' Nov 2014';
         $data[$i] = rand(1, 20000);
         $data2[$i] = rand(1, 20000);
     }
     // $c1 = new ChartComponent("c1");
     // $c1->setCaption("Sales");
     // $c1->setDimensions(4, 4);
     // $c1->setLabels($labels);
     // $c1->addSeries("sales", "Sales", $data, array ("seriesDisplayType"=> 'column', "numberPrefix"=> '$'));
     // $this->addComponent ($c1);
     $c2 = new ChartComponent("c2");
     $c2->setCaption("Sales");
     $c2->setDimensions(6, 4);
     $c2->setLabels($labels);
     $c2->setYAxis("Hello");
     $c2->addYAxis("quantity", "Quantity", array("numberPrefix" => "#", 'numberHumanize' => true));
     $c2->addSeries("sales", "Sales", $data, array("seriesDisplayType" => 'column', "numberPrefix" => '$', 'numberHumanize' => true));
     $c2->addSeries("sales2", "Sales", $data2, array("seriesDisplayType" => 'column', "numberPrefix" => '$', 'yAxis' => 'quantity', 'numberHumanize' => true));
     $c2->setLabelStep(5);
     $this->addComponent($c2);
 }
Exemple #2
0
 public function buildDashboard()
 {
     $chart = new ChartComponent('chart');
     $chart->setCaption("Visits by Month");
     $chart->setDimensions(8, 6);
     $chart->setLabels(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]);
     $chart->addSeries("2013", "2013", [420000, 460000, 480000, 520000, 560000, 510000, 470000, 430000, 420000, 370000, 360000, 360000], array("seriesDisplayType" => "area"));
     $chart->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart1 = new ChartComponent('c');
     $chart1->setDimensions(6, 4);
     $chart1->setCaption('Top 10 Genres by sales');
     $chart1->setLabels(['Rock', 'Latin', 'Metal', 'Alternative & Punk', 'TV Shows', 'Jazz', 'Blues', 'Drama', 'R&B/Soul', 'Classical']);
     $chart1->addSeries('sales', 'Ȁ ȁ Ȃ ȃ Ȅ ȅ Ȇ ȇ Ȉ ȉ Ȋ ȋ Ȍ ȍ Ȏ ȏ Ȑ ȑ Ȓ ȓ Ȕ ȕ Ȗ ȗ Ș ș Ț ț Ȝ ȝ Ȟ ȟ', [826.25, 382.14, 261.36, 241.56, 93.53, 79.2, 60.39, 57.71, 40.59, 40.59]);
     $chart1->setYAxis('', array('numberPrefix' => '$'));
     $this->addComponent($chart1);
 }
Exemple #4
0
 public function buildDashboard()
 {
     $chart = new ChartComponent('chart');
     $chart->setCaption("Number of monthly unique visitors on a website in 2013");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"));
     $chart->addSeries("sales_2013", "2013", array(420000, 460000, 480000, 520000, 560000, 510000, 470000, 430000, 420000, 370000, 360000, 360000), array("seriesDisplayType" => "area"));
     $chart->setYAxis('Number of visitors', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent("my_first_chart");
     $chart->setCaption("Car Sales figures");
     $chart->setYAxis("Sales", array("numberPrefix" => "\$", "numberHumanize" => true));
     $chart->setDimensions(4, 4);
     $chart->setLabels(["Jan", "Feb", "Mar"]);
     $chart->addSeries("sales", "Sales", [1355340, 2214134, 1854313], array("seriesDisplayType" => "column", "numberPrefix" => "\$"));
     $chart->addSeries("car_quantity", "Quantity", [14, 19, 17], array());
     $this->addComponent($chart);
 }
Exemple #6
0
 public function buildDashboard()
 {
     $chart = new ChartComponent("my_first_chart");
     $chart->setCaption("Expenses incurred for Food Consumption by Month");
     $chart->setYAxis("Sales", array("numberPrefix" => "\$"));
     $chart->setDimensions(4, 4);
     $chart->setLabels(["Jan", "Feb", "Mar"]);
     $chart->addSeries("beverages", "Beverages", [1355, 1916, 1150]);
     $chart->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321]);
     $this->addComponent($chart);
 }
Exemple #7
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("2013", "2013", array(22400, 24800, 21800, 21800, 24600, 27600, 26800, 27700, 23700, 25900, 26800, 24800), array("seriesDisplayType" => "line"));
     $chart->addSeries("2012", "2012", array(10000, 11500, 12500, 15000, 16000, 17600, 18800, 19700, 21700, 21900, 22900, 20800), array("seriesDisplayType" => "line"));
     $chart->setYAxis('Sales', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent("Monthly Sales Summary Comparision");
     $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], array("seriesStacked" => true, "seriesDisplayType" => "bar"));
     $chart->addSeries("2012", "2012", [10000, 11500, 12500, 15000, 16000, 17600, 18800, 19700, 21700, 21900, 22900, 20800], array("seriesStacked" => true, "seriesDisplayType" => "bar"));
     $chart->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setCaption("Most spent on activity in a company");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array("Software Development", "Social Networking", "Communication", "Reference", "Utility"));
     $chart->addSeries("john", "John", array(1.1, 0.3, 1.3, 2.2, 1.6), array("seriesStacked" => true, "seriesDisplayType" => "bar"));
     $chart->addSeries("mark", "Mark", array(2.1, 0.6, 1.8, 0.9, 1.4), array("seriesStacked" => true, "seriesDisplayType" => "bar"));
     $chart->setYAxis('', array("numberSuffix" => 'h'));
     $this->addComponent($chart);
 }
Exemple #10
0
 public function buildDashboard()
 {
     $chart = new ChartComponent('chart');
     $chart->setCaption("Costs by division - 2013 vs 2012");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array('Manufacturing', 'Publishing', 'Transportation', 'Communications'));
     $chart->addSeries("sales2013", "2013", array(24400, 27800, 23800, 24800), array("seriesDisplayType" => 'bar'));
     $chart->addSeries("sales2012", "2012", array(15000, 15000, 17500, 20000), array("seriesDisplayType" => 'bar'));
     $chart->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent("sales_chart");
     $chart->setCaption("Sales - 2013 vs 2012");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array("Jan", "Feb", "Mar", "Apr", "May"));
     $chart->addSeries("2013", "2013", array(1, 3, -1, 1, 9), array("seriesStacked" => true));
     $chart->addSeries("2012", "2012", array(2, 1, -3, 3, 1), array("seriesStacked" => true));
     $chart->setYAxis('Sales', array("numberPrefix" => '$', "numberHumanize" => true));
     $chart->setOption("stackedTotalDisplay", true);
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent("2011_sales");
     $chart->setDimensions(4, 4);
     $chart->setCaption("Stacked Column Chart");
     $chart->setYAxis("", array('numberPrefix' => "\$"));
     $chart->setLabels(["Jan", "Feb", "Mar"]);
     $chart->addSeries("beverages", "Beverages", [1355, 1916, 1150], array('numberPrefix' => "\$", 'seriesStacked' => true, 'seriesDisplayType' => "column"));
     $chart->addSeries("packaged_foods", "Packaged Foods", [1513, 976, 1321], array('numberPrefix' => "\$", 'seriesStacked' => true, 'seriesDisplayType' => "column"));
     $chart->addSeries("vegetables", "Vegetables", [1313, 1976, 924], array('numberPrefix' => "\$", 'seriesStacked' => true, 'seriesDisplayType' => "column"));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent('chart');
     $chart->setCaption("Visits from search engines");
     $chart->setDimensions(8, 6);
     $chart->setLabels(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]);
     $chart->setYAxis("", array("numberPrefix" => "\$"));
     $chart->addSeries("Google", "Google", [3040, 2794, 3026, 3341, 2800, 2507, 3701, 2671, 2980, 2041, 1813, 1691], array("seriesStacked" => true, "seriesDisplayType" => "column"));
     $chart->addSeries("Yahoo", "Yahoo", [1200, 1124, 1006, 921, 1500, 1007, 921, 971, 1080, 1041, 1113, 1091], array("seriesStacked" => true, "seriesDisplayType" => "column"));
     $chart->addSeries("MSN", "MSN", [600, 724, 806, 621, 700, 907, 821, 671, 880, 641, 913, 691], array("seriesStacked" => true, "seriesDisplayType" => "column"));
     $chart->addSeries("Others", "Others", [965, 771, 732, 611, 700, 607, 621, 751, 800, 741, 813, 791], array("seriesStacked" => true, "seriesDisplayType" => "column"));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent('chart');
     $chart->setDimensions(8, 6);
     $chart->setCaption('Annual Sales Summary (2010 - 2013');
     $chart->setLabels(['2010', '2011', '2012', '2013']);
     $chart->addSeries('sales', 'Sales', [1160000, 1040000, 1020000, 1160000]);
     $chart->setYAxis('', array('numberPrefix' => '$', 'numberHumanize' => true));
     $selectedYear;
     $chart->addDrillStep('firstDrill', $this);
     $chart->addDrillStep('secondDrill', $this);
     $this->addComponent($chart);
 }
Exemple #15
0
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setDimensions(8, 6);
     $chart->setYAxis("Sales", array("numberPrefix" => "\$ ", "numberHumanize" => true));
     $chart->addYAxis('profit', "Profit %", array("numberSuffix" => "%"));
     $chart->setCaption("Showing monthly sales and profit of a retail company");
     $chart->setLabels(array("March", "April", "May", "June", "July"));
     $chart->addSeries("product_A", "Product A", array(25601.34, 20148.82, 17372.76, 35407.15, 38105.68), array("numberPrefix" => '$', "seriesDisplayType" => 'column'));
     $chart->addSeries("product_B", "Product B", array(57401.85, 41941.19, 45263.37, 117320.16, 114845.27), array("numberPrefix" => '$', "seriesDisplayType" => 'column'));
     $chart->addSeries("profit", "Profit %", array(20, 42, 10, 23, 16), array("numberPrefix" => '$', "seriesDisplayType" => 'line', "yAxis" => "profit"));
     $this->addComponent($chart);
 }
Exemple #16
0
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setCaption("Visits from search engines");
     $chart->setDimensions(8, 6);
     $chart->setYAxis("Revenue", array("numberPrefix" => "\$ ", "numberHumanize" => true));
     $chart->addYAxis('quantity', "Quantity", array());
     $chart->setCaption("Sales");
     $chart->setLabels(["March", "April", "May", "June", "July"]);
     $chart->addSeries("product_A", "Product A", [25601.34, 20148.82, 17372.76, 35407.15, 38105.68], array("numberPrefix" => '$', "seriesDisplayType" => 'column'));
     $chart->addSeries("product_B", "Product B", [57401.85, 41941.19, 45263.37, 117320.16, 114845.27], array("numberPrefix" => '$', "seriesDisplayType" => 'column'));
     $chart->addSeries("total_quantity", "Total Quantity", [45000, 44835, 42835, 77557, 92633], array("numberPrefix" => '$', "seriesDisplayType" => 'line', "yAxis" => "quantity"));
     $this->addComponent($chart);
 }
 public function buildDashboard()
 {
     $kpi1 = new KPIComponent("kpi1");
     $kpi1->setCaption("Number of checkouts in 24h");
     $kpi1->setDimensions(3, 2);
     $kpi1->setValue(324);
     $this->addComponent($kpi1);
     $kpi2 = new KPIComponent("kpi2");
     $kpi2->setCaption("Sales in last 24h");
     $kpi2->setDimensions(3, 2);
     $kpi2->setValue(47, array('numberPrefix' => '$'));
     $this->addComponent($kpi2);
     $kpi3 = new KPIComponent("kpi3");
     $kpi3->setCaption("Number of checkouts this week");
     $kpi3->setDimensions(3, 2);
     $kpi3->setValue(1024);
     $this->addComponent($kpi3);
     $kpi4 = new KPIComponent("kpi4");
     $kpi4->setCaption("Total sales this week");
     $kpi4->setDimensions(3, 2);
     $kpi4->setValue(245, array('numberPrefix' => '$'));
     $this->addComponent($kpi4);
     $chart1 = new ChartComponent("chart1");
     $chart1->setCaption("Sales per product category");
     $chart1->setDimensions(6, 6);
     $chart1->setLabels(['Beverages', 'Condiments', 'Dairy Products', 'Grains / Cereal', 'Meat / Poultry']);
     $sales = $this->randomGen(5, 4000);
     $chart1->addSeries('sales', 'Sales', $sales, array('numberPrefix' => '$'));
     $chart1->setYAxis('', array('numberPrefix' => '$'));
     $this->addComponent($chart1);
     $chart2 = new ChartComponent("chart2");
     $chart2->setCaption("Sales per employee");
     $chart2->setDimensions(6, 6);
     $chart2->setLabels(['Robert', 'Margaret', 'Nancy', 'Andrew', 'Janet']);
     $chart2->addSeries('sales', 'Sales', [56500, 57590, 65820, 79960, 82030], array('seriesDisplayType' => 'column'));
     $chart2->setYAxis('', array('numberPrefix' => '$'));
     $this->addComponent($chart2);
     $chart3 = new ChartComponent("chart3");
     $chart3->setCaption("Gender distribution of shoppers");
     $chart3->setDimensions(6, 6);
     $chart3->setLabels(['Female', 'Male']);
     $chart3->addSeries('gender', 'Gender', [58, 42], array('seriesDisplayType' => 'pie'));
     $this->addComponent($chart3);
     $chart4 = new ChartComponent("chart4");
     $chart4->setCaption("Age group of shoppers");
     $chart4->setDimensions(6, 6);
     $chart4->setLabels(['Under 15', '15-30', '30-45', '45-60', '60+']);
     $chart4->addSeries('age', 'Age', [8, 28, 32, 22, 10], array('seriesDisplayType' => 'column'));
     $this->addComponent($chart4);
 }
Exemple #18
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);
 }
 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);
 }
 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);
 }
 public function buildDashboard()
 {
     $chart1 = new ChartComponent('my_chart1');
     $chart1->setDimensions(6, 4);
     $chart1->setCaption('Top 10 Genres by sales');
     $chart1->setLabels(['Rock', 'Latin', 'Metal', 'Alternative & Punk', 'TV Shows', 'Jazz', 'Blues', 'Drama', 'R&B/Soul', 'Classical']);
     $chart1->addSeries('sales', 'Sales', [826.25, 382.14, 261.36, 241.56, 93.53, 79.2, 60.39, 57.71, 40.59, 40.59]);
     $chart1->setYAxis('', array('numberPrefix' => '$'));
     $c2 = new ChartComponent('my_chart2');
     $c2->setDimensions(6, 4);
     $c2->setCaption('Units By Year');
     $c2->hideComponent();
     $chart1->onItemClick(array($chart1, $c2), 'handleClick', $this);
     $this->addComponent($chart1);
     $this->addComponent($c2);
 }
 public function buildDashboard()
 {
     $chart1 = new ChartComponent('chart1');
     $chart1->setCaption('Top 10 Genres by sales');
     $chart1->setDimensions(6, 4);
     $chart1->setLabels(['Rock', 'Latin', 'Metal', 'Alternative & Punk', 'TV Shows', 'Jazz', 'Blues', 'Drama', 'R&B/Soul', 'Classical']);
     $chart1->addSeries("sales", "Sales", [826.25, 382.14, 261.36, 241.56, 93.53, 79.2, 60.39, 57.71, 40.59, 40.59]);
     $chart1->setYAxis('', array('numberPrefix' => '$'));
     $this->addComponent($chart1);
     $chart2 = new ChartComponent('chart2');
     $chart2->setCaption('Units By Year');
     $chart2->setDimensions(6, 4);
     $chart2->setLabels(['2007', '2008', '2009', '2010', '2011']);
     $chart2->addSeries("unit", "Units", [454, 455, 236, 195, 442], array('seriesDisplayType' => 'line'));
     $this->addComponent($chart2);
     $chart3 = new ChartComponent('chart3');
     $chart3->setCaption('Unit Distribution By Genre');
     $chart3->setDimensions(6, 4);
     $chart3->setLabels(['Rock', 'Jazz', 'Blues', 'Metal', 'Latin']);
     $chart3->addSeries("sales", "Sales", [46.16, 4.42, 13.49, 14.59, 21.34], array('seriesDisplayType' => 'pie', 'numberSuffix' => '%'));
     $this->addComponent($chart3);
     $chart4 = new ChartComponent('chart4');
     $chart4->setCaption('Yearly Sales for Top 5 Genres');
     $chart4->setDimensions(6, 4);
     $chart4->setLabels(['2007', '2008', '2009', '2010', '2011']);
     $chart4->addSeries('rock', 'Rock', [178.2, 155.43, 161.37, 157.41, 174.24], array("numberPrefix" => "\$"));
     $chart4->addSeries('latin', 'Latin', [82.17, 77.22, 80.19, 63.36, 79.2], array("numberPrefix" => "\$"));
     $chart4->addSeries('metal', 'Metal', [61.38, 53.46, 30.69, 80.39, 44.45], array("numberPrefix" => "\$"));
     $chart4->addSeries('blues', 'Blues', [62.37, 59.6, 45.54, 38.61, 5.94], array("numberPrefix" => "\$"));
     $chart4->addSeries('jazz', 'Jazz', [174.24, 79.2, 55.45, 55.44, 21.78], array("numberPrefix" => "\$"));
     $this->addComponent($chart4);
     $chart5 = new ChartComponent('chart5');
     $chart5->setCaption('Revenue by year');
     $chart5->setDimensions(6, 4);
     $chart5->setLabels(['2007', '2008', '2009', '2010', '2011']);
     $chart5->addSeries('revenueUS', 'Revenue in US', [449.46, 481.45, 483.44, 463.67, 450.58], array("numberPrefix" => "\$"));
     $chart5->addSeries('revenueUK', 'Revenue in UK', [454, 455, 456, 433, 442], array("seriesDisplayType" => "line", "numberPrefix" => "\$"));
     $this->addComponent($chart5);
     $chart1->setComponentOrderIndex(4);
     $chart2->setComponentOrderIndex(0);
     $chart3->setComponentOrderIndex(1);
     $chart4->setComponentOrderIndex(2);
     $chart5->setComponentOrderIndex(3);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent();
     $chart->setCaption("Company Revenue and Profits");
     $chart->setDimensions(8, 6);
     $chart->setLabels(array("Aug", "Sept", "Oct", "Nov", "Dec"));
     $chart->addSeries("revenue", "Product A", array(20000, 17000, 22000, 19000, 23000), array("numberPrefix" => "\$"));
     $chart->addYAxis("profit", "Profit %", array("numberSuffix" => "%"));
     $chart->addSeries("profit", "Profit %", array(25, 5.88, 36.36, 10.52, 30.43), array("seriesDisplayType" => "line", "numberSuffix" => "%", "yAxis" => "profit"));
     $chart->setYAxis('Revenue', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
     $chart1 = new ChartComponent();
     $chart1->setCaption("Company Sales");
     $chart1->setDimensions(6, 6);
     $chart1->setLabels(array("Jan", "Feb", "Mar", "Apr", "May", "June"));
     $chart1->addSeries("Revenue", "Revenue", array(5854, 4171, 1375, 1875, 2246, 2696));
     $chart1->addSeries("Profit", "Profit", array(3242, 3171, 700, 1287, 1856, 1126), array("seriesDisplayType" => "area"));
     $chart1->addSeries("Predicted_Profit", "Predicted Profit", array(4342, 2371, 740, 3487, 2156, 1326), array("seriesDisplayType" => "line"));
     $chart1->setYAxis('Sales', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart1);
 }
 public function buildDashboard()
 {
     $chart = new ChartComponent("Sales - 2013 v 2012");
     $chart->setCaption("Company Revenue");
     $chart->setDimensions(8, 6);
     $chart->setLabels(["Aug", "Sept", "Oct", "Nov", "Dec"]);
     $chart->addSeries("prod_a", "Product A", [36000, 34300, 30000, 27800, 25000]);
     $chart->addSeries("prod_b", "Product B", [31000, 29300, 26000, 21000, 20500]);
     $chart->addSeries("Predicted", "Predicted", [25000, 23000, 20000, 18000, 14500], array("seriesDisplayType" => "line"));
     $chart->addSeries("avg", "2004 Avg.", [17000, 15000, 16000, 11500, 10000], array("seriesDisplayType" => "line"));
     $chart->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart);
     $chart1 = new ChartComponent();
     $chart1->setCaption("Sales");
     $chart1->setDimensions(6, 6);
     $chart1->setLabels(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]);
     $chart1->addSeries("Revenue", "Revenue", [5854, 4171, 1375, 1875, 2246, 2696, 1287, 2140, 1603, 1628]);
     $chart1->addSeries("Profit", "Profit", [3242, 3171, 700, 1287, 1856, 1126, 987, 1610, 903, 928], array("seriesDisplayType" => "area"));
     $chart1->addSeries("Predicted_Profit", "Predicted Profit", [4342, 2371, 740, 3487, 2156, 1326, 1087, 1710, 703, 928], array("seriesDisplayType" => "line"));
     $chart1->setYAxis('', array("numberPrefix" => '$', "numberHumanize" => true));
     $this->addComponent($chart1);
 }
Exemple #25
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);
 }
 public function buildDashboard()
 {
     $c1 = new ChartComponent('c1');
     $c1->setCaption("Column Chart");
     $c1->setDimensions(4, 4);
     $c1->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c1->addSeries("seriesA", "Series A", [21, 33, 25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$'));
     $c1->setYAxis("", array('minValue' => 10, 'maxValue' => 60, 'numTicks' => 6));
     $this->addComponent($c1);
     $c2 = new ChartComponent('c2');
     $c2->setCaption("Column Chart Dual Axis");
     $c2->setDimensions(4, 4);
     $c2->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c2->addSeries("seriesA", "Series A", [21, 33, 25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$'));
     $c2->addSeries("seriesB", "Series B", array_reverse([21, 33, 25, 41, 59]), array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'yAxis' => 'second'));
     $c2->setYAxis("", array('minValue' => 10, 'maxValue' => 60, 'numTicks' => 6));
     $c2->addYAxis("second", "", array('minValue' => 10, 'maxValue' => 60, 'numTicks' => 6));
     $this->addComponent($c2);
     $c3 = new ChartComponent('c3');
     $c3->setCaption("Column Chart Stacked");
     $c3->setDimensions(4, 4);
     $c3->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c3->addSeries("seriesA", "Series A", [21, 33, 25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c3->addSeries("seriesB", "Series B", array_reverse([21, 33, 25, 41, 59]), array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c3->setYAxis("", array('minValue' => 21, 'maxValue' => 81, 'numTicks' => 6));
     $this->addComponent($c3);
     $c4 = new ChartComponent('c4');
     $c4->setCaption("Column Chart Negative");
     $c4->setDimensions(4, 4);
     $c4->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c4->addSeries("seriesA", "Series A", [21, 33, -25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$'));
     $c4->setYAxis("", array('minValue' => -30, 'maxValue' => 60, 'numTicks' => 10));
     $this->addComponent($c4);
     $c5 = new ChartComponent('c5');
     $c5->setCaption("Column Chart Dual Axis Negative");
     $c5->setDimensions(4, 4);
     $c5->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c5->addSeries("seriesA", "Series A", [21, 33, -25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$'));
     $c5->addSeries("seriesB", "Series B", array_reverse([21, 33, -25, 41, 59]), array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'yAxis' => 'second'));
     $c5->setYAxis("", array('minValue' => -30, 'maxValue' => 60, 'numTicks' => 10));
     $c5->addYAxis("second", "", array('minValue' => -30, 'maxValue' => 60, 'numTicks' => 10));
     $this->addComponent($c5);
     $c6 = new ChartComponent('c6');
     $c6->setCaption("Column Chart Stacked Negative");
     $c6->setDimensions(4, 4);
     $c6->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c6->addSeries("seriesA", "Series A", [21, 33, -25, 41, 59], array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c6->addSeries("seriesB", "Series B", array_reverse([21, 33, -25, 41, 59]), array('seriesDisplayType' => 'column', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c6->setYAxis("", array('minValue' => -50, 'maxValue' => 90, 'numTicks' => 15));
     $this->addComponent($c6);
     $c7 = new ChartComponent('c7');
     $c7->setCaption("Bar Chart");
     $c7->setDimensions(4, 4);
     $c7->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c7->addSeries("seriesA", "Series A", [21, 33, 25, 41, 59], array('seriesDisplayType' => 'bar', 'numberPrefix' => '$'));
     $c7->setXAxis("", array('minValue' => 10, 'maxValue' => 60, 'numTicks' => 6));
     $this->addComponent($c7);
     $c8 = new ChartComponent('c8');
     $c8->setCaption("Bar Chart Negative");
     $c8->setDimensions(4, 4);
     $c8->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c8->addSeries("seriesA", "Series A", [21, 33, -25, 41, 59], array('seriesDisplayType' => 'bar', 'numberPrefix' => '$'));
     $c8->setXAxis("", array('minValue' => -30, 'maxValue' => 60, 'numTicks' => 10));
     $this->addComponent($c8);
     $c9 = new ChartComponent('c9');
     $c9->setCaption("Bar Chart Stacked");
     $c9->setDimensions(4, 4);
     $c9->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c9->addSeries("seriesA", "Series A", [21, 33, 25, 41, 59], array('seriesDisplayType' => 'bar', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c9->addSeries("seriesB", "Series B", array_reverse([21, 33, 25, 41, 59]), array('seriesDisplayType' => 'bar', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c9->setXAxis("", array('minValue' => 21, 'maxValue' => 81, 'numTicks' => 6));
     $this->addComponent($c9);
     $c10 = new ChartComponent('c10');
     $c10->setCaption("Bar Chart Stacked Negative");
     $c10->setDimensions(4, 4);
     $c10->setLabels(['January', 'February', 'March', 'April', 'May']);
     $c10->addSeries("seriesA", "Series A", [21, 33, -25, 41, 59], array('seriesDisplayType' => 'bar', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c10->addSeries("seriesB", "Series B", array_reverse([21, 33, 25, 41, 59]), array('seriesDisplayType' => 'bar', 'numberPrefix' => '$', 'seriesStacked' => true));
     $c10->setXAxis("", array('minValue' => -50, 'maxValue' => 90, 'numTicks' => 15));
     $this->addComponent($c10);
 }
 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);
 }