mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Some changes in the charts and range thing.
This commit is contained in:
		| @@ -2,6 +2,7 @@ | ||||
|  | ||||
| use Carbon\Carbon as Carbon; | ||||
| use Firefly\Storage\Account\AccountRepositoryInterface as ARI; | ||||
| use Firefly\Helper\Toolkit\Toolkit as tk; | ||||
|  | ||||
| class ChartController extends BaseController | ||||
| { | ||||
| @@ -16,17 +17,16 @@ class ChartController extends BaseController | ||||
|     /** | ||||
|      * Show home charts. | ||||
|      */ | ||||
|     public function home($account = null) | ||||
|     public function homeAccount($account = null) | ||||
|     { | ||||
|         list($start,$end) = tk::getDateRange(); | ||||
|         $current = clone $start; | ||||
|  | ||||
|         // chart | ||||
|         $chart = App::make('gchart'); | ||||
|         $chart->addColumn('Day of the month', 'date'); | ||||
|  | ||||
|         // date | ||||
|         $today = new Carbon; | ||||
|         $past = clone $today; | ||||
|         $past->subMonth(); | ||||
|         $current = clone $past; | ||||
|  | ||||
|  | ||||
|         if (is_null($account)) { | ||||
|             // get accounts: | ||||
| @@ -36,7 +36,7 @@ class ChartController extends BaseController | ||||
|                 $chart->addColumn($account->name, 'number'); | ||||
|             } | ||||
|  | ||||
|             while ($current <= $today) { | ||||
|             while ($current <= $end) { | ||||
|                 $row = [clone $current]; | ||||
|  | ||||
|                 // loop accounts: | ||||
| @@ -52,7 +52,7 @@ class ChartController extends BaseController | ||||
|                 return View::make('error')->with('message', 'No account found.'); | ||||
|             } | ||||
|             $chart->addColumn($account->name, 'number'); | ||||
|             while ($current <= $today) { | ||||
|             while ($current <= $end) { | ||||
|                 $row = [clone $current, $account->balance(clone $current)]; | ||||
|                 $current->addDay(); | ||||
|                 $chart->addRowArray($row); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user