Work on new chart for year report.

This commit is contained in:
James Cole
2016-06-16 20:52:30 +02:00
parent bdee8cde77
commit 6267930938
4 changed files with 134 additions and 20 deletions

View File

@@ -61,21 +61,55 @@
</div>
</div>
{% for budget in budgets %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box" id="year-budget-{{ budget.id }}">
<div class="box-header with-border">
<h3 class="box-title">{{ 'budget'|_ }} {{ budget.name }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="budgets_{{ budget.id }}" class="budget_year_chart" data-budget="{{ budget.id }}"
style="width:100%;height:400px;"></canvas>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'budgets'|_ }}</h3>
</div>
<div class="box-body">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>&nbsp;</th>
{% for date, header in budgets.get('headers') %}
<th>{{ header }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% set spentData = budgets.get('spent') %}
{% for budgetId, budgetName in budgets.get('budgets') %}
<tr>
<th>
<a title="{{ budgetName }}" href="#" data-budget="{{ budgetId }}" class="budget-chart-activate">{{ budgetName }}</a>
</th>
{% for date, header in budgets.get('headers') %}
<td>{{ spentData[budgetId][date]|formatAmount }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'chart'|_ }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="budget_chart" style="width:100%;height:400px;"></canvas>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}