diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 8f3709758..2612327fe 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -574,7 +574,7 @@ class Reports extends Secure_area $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); $labels = array(); - $series = ''; + $series = array(); foreach($report_data as $row) { $labels[] = $row['customer']; @@ -615,8 +615,8 @@ class Reports extends Secure_area "title" => $this->lang->line('reports_discounts_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), "chart_type" => "reports/graphs/bar", - "labels_1" => rtrim($labels, ", "), - "series_data_1" => rtrim($series, ", "), + "labels_1" => $labels, + "series_data_1" => $series, "summary_data_1" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), "yaxis_title" => $this->lang->line('reports_count'), "xaxis_title" => $this->lang->line('reports_discount_percent') @@ -633,20 +633,20 @@ class Reports extends Secure_area $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - $labels = ''; - $series = ''; + $labels = array(); + $series = array(); foreach($report_data as $row) { - $labels .= "'" . $row['payment_type'] . "', "; - $series .= $row['payment_amount'] . ", "; + $labels[] = $row['payment_type']; + $series[]= $row['payment_amount']; } $data = array( "title" => $this->lang->line('reports_payments_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), "chart_type" => "reports/graphs/pie", - "labels_1" => rtrim($labels, ", "), - "series_data_1" => rtrim($series, ", "), + "labels_1" => $labels, + "series_data_1" => $series, "summary_data_1" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) ); diff --git a/application/views/reports/graphs/bar.php b/application/views/reports/graphs/bar.php index 226302c86..3a8c2ea4c 100644 --- a/application/views/reports/graphs/bar.php +++ b/application/views/reports/graphs/bar.php @@ -23,6 +23,9 @@ offset: 60 }, + width: '100%', + height: '75%', + // plugins configuration plugins: [ Chartist.plugins.ctAxisTitle({ @@ -31,7 +34,7 @@ axisClass: 'ct-axis-title', offset: { x: 0, - y: 100 + y: 80 }, textAnchor: 'middle' }, diff --git a/application/views/reports/graphs/hbar.php b/application/views/reports/graphs/hbar.php index 1b9644f93..f613cba8f 100644 --- a/application/views/reports/graphs/hbar.php +++ b/application/views/reports/graphs/hbar.php @@ -25,6 +25,9 @@ offset: 120 }, + width: '80%', + height: '80%', + // plugins configuration plugins: [ Chartist.plugins.ctAxisTitle({ diff --git a/application/views/reports/graphs/pie.php b/application/views/reports/graphs/pie.php index 3b8398698..91c173d24 100644 --- a/application/views/reports/graphs/pie.php +++ b/application/views/reports/graphs/pie.php @@ -1,15 +1,17 @@