Skip to content

Commit

Permalink
Check if results are given and put info into chart of not #38
Browse files Browse the repository at this point in the history
  • Loading branch information
4lm committed May 21, 2019
1 parent df75367 commit bdd17da
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions static/stemp_abw/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ function execClickAction(e) {
+ String(layer.feature.id) + "/"
$.get(url_js, function (data) {
setTimeout(function () {
var result_chart = document.querySelector('.result-chart [id^=\"hc_\"]');
if (result_chart !== null) {
$.ajax({
url: '/stemp_abw/results/',
type: "GET",
success: function (data) {
if (data == null) {
var id=parseInt(result_chart.getAttribute('data-highcharts-chart'));
Highcharts.charts[id].showLoading('Das Szenario wurde verändert.</br>Für Ergebnisse bitte Simulation starten.');
}
},
error: function (page) {
console.log('error');
showErrorPopup();
},
cache: false
});
}
eval(data);
}, 250);
});
Expand Down
2 changes: 1 addition & 1 deletion templates/stemp_abw/popups/pop_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block values %}: {{ layer.pop_result }} EinwohnerInnen{% endblock %}

{% block vis %}
<div class="cell" style="height: 252px;">
<div class="cell result-chart" style="height: 252px;">
{{ chart }}
</div>
{% endblock%}

0 comments on commit bdd17da

Please sign in to comment.