{% extends 'layouts/main-charts.html' %} {% block viewBySize %}sm{% endblock %} {% block viewBySize %}sm{% endblock %} {% block viewBy %}
{% endblock %} {% block largeChartStyle %} {% if largeChart.data.series.length > 1 || largeChart.data.legend %} {% for colour in largeChart.data.colour %} .lg-chart-{{ loop.key }}-bk { background-color: {{ colour }}; } {% endfor %} {% endif %} {% endblock %} {% block reportTopChart %}
{% for chart in reportTopCharts %}
{{ chart.number }}
{{ chart.text }}
{% endfor %}

{% endblock %} {% block largeChart %}
{% if largeChart.data.series.length > 1 || largeChart.data.legend %}
{% for name in largeChart.data.name %}
{{ name }}
{% endfor %}
{% endif %}
{% endblock %} {% block largeChartScript %} {% if largeChart.data.series || (largetChart.data.series !== null && largeChart.data.series.sum() !== 0) %} var largeChart = {}; largeChart.labels = JSON.parse('{{ JSON.stringify(largeChart.data.labels) }}'); largeChart.series = JSON.parse('{{ JSON.stringify(largeChart.data.series) }}'); largeChart.colour = JSON.parse('{{ JSON.stringify(largeChart.data.colour) }}'); largeChart.yOffset = parseInt(getCSS('ct-label', 'font-size')); largeChart.chart = new Chartist.{% if largeChart.type === 'line' %}Line{% else %}Bar{% endif %}('.lg-chart', { labels: largeChart.labels, series: largeChart.series }, { {% if largeChart.data.series.stackMax() %} high: {{ Math.ceil(largeChart.data.series.stackMax() * 1.1) }}, {% endif %} fullWidth: true, stackBars: true, lineSmooth: false, axisX: { labelInterpolationFnc: function skipLabels(value, index) { return index % Math.ceil(largeChart.labels.length * {% if selectDate === 2 %}25{% else %}50{% endif %} / $('.lg-chart').width()) === 0 ? value : null; }, showGrid: false }, axisY: { onlyInteger: true, labelInterpolationFnc: humanize }, plugins: [ Chartist.plugins.tooltip({class: 'tool-tip'}) ] }); largeChart.chart.on('draw', function(data) { if (data.type === 'grid' && data.axis.counterUnits.dir === 'horizontal') { if (data.index % 2 === 1) { data.element.remove(); } } if (data.type === '{% if largeChart.type === 'line' %}line{% else %}bar{% endif %}') { data.element.attr({ style: 'stroke: ' + largeChart.colour[data.seriesIndex] + ';' + 'stroke-width: ' {%if largeChart.type === 'line' %} + 2 {% else %} + (($('.lg-chart').width() / largeChart.labels.length) * 0.75) {% endif %} + 'px;' }); } {% if largeChart.type === 'line' %} if (data.type === 'point') { data.element.remove(); } {% endif %} if (data.type === 'label' && data.axis.units.dir === 'vertical') { data.element.attr({ y: data.y + largeChart.yOffset / 2 }); } }); {% endif %} {% endblock %} {% block tableChart %} {% if largeChart.table %} {% for name in largeChart.data.name %} {% endfor %} {% for label in largeChart.data.tableLabels %} {% set i = loop.key %} {% for series in largeChart.data.series %} {% endfor %} {% endfor %}
{{ labels.date }} {{ name }}
{{ label }} {{ series[i] }}
{% endif %} {% endblock %}