{% extends 'layouts/navigation.html' %} {% block headStyle %} {% for row in mainCharts %} {% for chart in row %} {% for target in chart.targets %} {% if target.legend %} {% for colour in target.data.colour %} .{{ target.name }}-{{ loop.key }}-bk { background-color: {{ colour }}; } {% endfor %} {% endif %} {% endfor %} {% endfor %} {% endfor %} {% block largeChartStyle %}{% endblock %} {% endblock %} {% block content %}

{% block titleHead %}{% endblock %}

{% block viewBy %} {% endblock %}

{% if topCharts %}
{% for chart in topCharts %}
{{ chart.text }}
{{ chart.label }}
{% endfor %}
{% endif %} {% block reportTopChart %}{% endblock %} {% block largeChart %}{% endblock %} {% block tableChart %}{% endblock %} {% block mainChart %}{% endblock %} {% endblock %} {% block bottomScript %} function humanize(value, index) { var absValue = Math.abs(value); if (absValue < 1000) { return value; } if (absValue < 1000000) { return value.rightShiftDecimal(3) + 'K'; } if (absValue < 1000000000) { return value.rightShiftDecimal(6) + 'M'; } if (absValue < 1000000000000) { return value.rightShiftDecimal(9) + 'G'; } if (absValue < 1000000000000000) { return value.rightShiftDecimal(12) + 'T'; } return value.rightShiftDecimal(15) + 'P'; } var topCharts = {}; {% for chart in topCharts %} {% if chart.data %} topCharts['{{ chart.name }}-series'] = JSON.parse('{{ JSON.stringify(chart.data.series) }}'); topCharts['{{ chart.name }}-width']; topCharts['{{ chart.name }}-max'] = topCharts['{{ chart.name }}-series'].max(); if (topCharts['{{ chart.name }}-max'] == 0) { topCharts['{{ chart.name }}-max'] = 1; } for (var i = 0; i < topCharts['{{ chart.name }}-series'].length; i++) { if (topCharts['{{ chart.name }}-series'][i] === 0) { topCharts['{{ chart.name }}-series'][i] = topCharts['{{ chart.name }}-max'] * 0.03; } } topCharts['{{ chart.name }}'] = new Chartist.Bar('.{{ chart.name }}-chart', { series: topCharts['{{ chart.name }}-series'] }, { distributeSeries: true, chartPadding: 0, high: topCharts['{{ chart.name }}-max'], axisX: { offset: 0, showLabel: false, showGrid: false }, axisY: { offset: 0, showLabel: false } }); topCharts['{{ chart.name }}'].on('draw', function(data) { if (data.type === 'grid') { data.element.remove(); } if (data.type === 'bar') { data.element.attr({ style: 'stroke: #69cbf4;' + 'stroke-width: ' + (($('.{{ chart.name }}-chart').width() / topCharts['{{ chart.name }}-series'].length) * 0.8) + 'px;' }); } }); {% endif %} {% endfor %} {% block largeChartScript %}{% endblock %} {% block mainChartScript %}{% endblock %} {% endblock %}