flask-chartist-example/app/templates/matplotlib.js
2017-05-21 10:48:38 -05:00

11 lines
288 B
JavaScript

function updateChartSrc(){
var nation = $("#nation option:selected").text()
var updatedData = $.get('/mpl/'.concat(nation));
updatedData.done(function(results){
$("img[name=population]").attr("src", results.src)
});
}
$("#nation").on('change', updateChartSrc);