First effort towards nice charts in the budgeting overviews.

This commit is contained in:
James Cole
2014-08-23 08:34:22 +02:00
parent 1b1dc99bf7
commit 871509d4d3
7 changed files with 466 additions and 41 deletions

View File

@@ -9,11 +9,12 @@
<!-- warning for selected limit -->
@if(isset($filters[0]) && is_object($filters[0]) && get_class($filters[0]) == 'Limit')
<p class="bg-primary" style="padding:15px;">
This view is filtered to show only the envelope from {{{$repetitions[0]['limitrepetition']->periodShow()}}}
with a total amount of {{mf($repetitions[0]['limit']->amount,false)}}.
This view is filtered to show only the envelope from
{{{$repetitions[0]['limitrepetition']->periodShow()}}},
which contains {{mf($repetitions[0]['limit']->amount,false)}}.
</p>
<p class="bg-info" style="padding:15px;">
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filters.</a>
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filter(s).</a>
</p>
@endif
@@ -23,7 +24,7 @@
This view is filtered to show transactions not in an envelope only.
</p>
<p class="bg-info" style="padding:15px;">
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filters.</a>
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filter(s).</a>
</p>
@endif
@@ -35,7 +36,7 @@
</p>
<p class="bg-info" style="padding:15px;">
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filters.</a>
<a href="{{route('budgets.show',$budget->id)}}" class="text-info">Reset the filter(s).</a>
</p>
@endif
@@ -44,23 +45,23 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div id="chart" style="height:300px;"></div>
@if(isset($filters[0]) && is_object($filters[0]) && get_class($filters[0]) == 'Limit')
<p class="small text-center">
A chart showing the date-range of the selected envelope, all transactions
as bars and the amount left in the envelope as a line.
</p>
<div id="instr" data-type="envelope" data-envelope="{{$repetitions[0]['limitrepetition']->id}}"></div>
@elseif(isset($filters[0]) && $filters[0] == 'no_envelope')
<div id="instr" data-type="no_envelope" data-budget="{{$budget->id}}"></div>
<p class="small text-center">
A chart showing the date-range of all the not-enveloped stuff, and their amount.
</p>
@elseif($useSessionDates == true)
<div id="instr" data-type="session" data-budget="{{$budget->id}}"></div>
<p class="small text-center">
Date range of session, show chart with all expenses in bars
find all limit repetitions, add them as individual lines and make them go down.
same as the first but bigger range (potentially).
</p>
@else
<div id="instr" data-type="default" data-budget="{{$budget->id}}"></div>
<p class="small text-center">(For each visible repetition, a sum of the expense as a bar. A line shows
the percentage spent for each rep.)</p>
@endif
@@ -107,4 +108,7 @@
@endif
@endforeach
@stop
@section('scripts')
<?php echo javascript_include_tag('budgets'); ?>
@stop