From 66a04d8365c0e9c66a9bc6d096204e9adaecff4c Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 1 May 2015 08:34:44 +0200 Subject: [PATCH] Slightly different chart on index. --- app/Http/Controllers/GoogleChartController.php | 7 ++++--- public/js/index.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/GoogleChartController.php b/app/Http/Controllers/GoogleChartController.php index 8b09f1aa0c..6898003e5a 100644 --- a/app/Http/Controllers/GoogleChartController.php +++ b/app/Http/Controllers/GoogleChartController.php @@ -144,8 +144,8 @@ class GoogleChartController extends Controller public function allBudgetsHomeChart(GChart $chart, BudgetRepositoryInterface $repository) { $chart->addColumn('Budget', 'string'); - $chart->addColumn('Budgeted', 'number'); - $chart->addColumn('Spent', 'number'); + $chart->addColumn('Left', 'number'); + //$chart->addColumn('Spent', 'number'); $budgets = $repository->getBudgets(); $start = Session::get('start', Carbon::now()->startOfMonth()); @@ -171,7 +171,8 @@ class GoogleChartController extends Controller foreach ($allEntries as $entry) { if ($entry[2] > 0) { - $chart->addRow($entry[0], $entry[1], $entry[2]); + $left = $entry[1] - $entry[0]; + $chart->addRow($entry[0], $left); } } diff --git a/public/js/index.js b/public/js/index.js index 89639a78ed..22a9081f06 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -3,7 +3,7 @@ google.setOnLoadCallback(drawChart); function drawChart() { googleLineChart('chart/home/account', 'accounts-chart'); - googleBarChart('chart/home/budgets', 'budgets-chart'); + googleColumnChart('chart/home/budgets', 'budgets-chart'); googleColumnChart('chart/home/categories', 'categories-chart'); googlePieChart('chart/home/bills', 'bills-chart'); getBoxAmounts();