Last active
September 30, 2018 23:27
-
-
Save andregardi/5f467e98d3b28c1e7558518b9054e43c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getChartData() { | |
$("#loadingMessage").html('<img src="./giphy.gif" alt="" srcset="">'); | |
$.ajax({ | |
url: "http://localhost:3000/chartdata", | |
success: function (result) { | |
$("#loadingMessage").html(""); | |
var data = []; | |
data.push(result.thisWeek); | |
data.push(result.lastWeek); | |
var labels = result.labels; | |
renderChart(data, labels); | |
}, | |
error: function (err) { | |
$("#loadingMessage").html("Error"); | |
} | |
}); | |
} | |
$("#renderBtn").click( | |
function () { | |
getChartData(); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment