Tile GetData
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 GetData() { | |
var xhttp = new XMLHttpRequest(); | |
xhttp.open("GET", "https://api.mobile.azure.com/v0.1/apps/silamb/XamarinDevDays/analytics/events/NormalOrdering/properties/TimeTaken/counts?start=2017-07-24&count=10", false); | |
xhttp.setRequestHeader("Content-type", "application/json"); | |
xhttp.setRequestHeader("X-API-Token", "a0a1a9dd0747e90d365a925ea3de9523d2beaf01"); | |
xhttp.send(); | |
var response = JSON.parse(xhttp.responseText); | |
total = 0; | |
for (i = 0; i < response.values.length; i++) { //loop through the array | |
total += +response.values[i].name / response.values.length; //Do the math! | |
} | |
document.getElementById('tileValue').innerHTML = total.toFixed(3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment