Fixed budget charts.

This commit is contained in:
James Cole 2015-01-24 07:46:57 +01:00
parent b766d93d9a
commit 4ad67a87f1
2 changed files with 7 additions and 6 deletions

View File

@ -8,7 +8,7 @@
Overview
</div>
<div class="panel-body">
<div id="componentOverview"></div>
<div id="budgetOverview"></div>
</div>
</div>
@ -71,7 +71,8 @@
@stop
@section('scripts')
<script type="text/javascript">
var componentID = {{$budget->id}};
var budgetID = {{$budget->id}};
var currencyCode = '{{Amount::getCurrencyCode()}}';
@if(!is_null($repetition))
var repetitionID = {{$repetition->id}};
var year = {{$repetition->startdate->format('Y')}};

View File

@ -7,11 +7,11 @@ $(function () {
$('.updateIncome').on('click', updateIncome);
if (typeof componentID != 'undefined' && typeof repetitionID == 'undefined') {
googleColumnChart('chart/budget/' + componentID + '/spending/' + year, 'componentOverview');
if (typeof budgetID != 'undefined' && typeof repetitionID == 'undefined') {
googleColumnChart('chart/budget/' + budgetID + '/spending/' + year, 'budgetOverview');
}
if (typeof componentID != 'undefined' && typeof repetitionID != 'undefined') {
googleLineChart('chart/budget/' + componentID + '/' + repetitionID, 'componentOverview');
if (typeof budgetID != 'undefined' && typeof repetitionID != 'undefined') {
googleLineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview');
}
});