bijoe: hide chart when there is no data

This commit is contained in:
Benjamin Dauvergne 2016-05-25 10:12:26 +02:00
parent f4f1dfc9b1
commit de130eec89
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,7 @@ $(function () {
$('form').submit();
});
})
{% if data %}
var data = {{ json|safe }};
linedata = {labels: [], datasets: []};
for (var i = 0; i < data.length; i++) {
@ -188,5 +189,6 @@ var ctx = $('canvas')[0].getContext("2d");
inGraphDataShow: true,
}
new Chart(ctx).Bar(linedata, option);
{% endif %}
</script>
{% endblock %}