From 753266b6d719a06f6924558b06d486f87f0c38e9 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Wed, 3 Oct 2018 21:58:18 +0100 Subject: [PATCH] Fix SLA Annotations --- chart.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chart.js b/chart.js index 2f489a2..81f37b8 100644 --- a/chart.js +++ b/chart.js @@ -1,13 +1,14 @@ // SLA Data sla = null -var xhttp = new XMLHttpRequest(); -xhttp.onreadystatechange = function() { +var xmlhttp = new XMLHttpRequest(); +xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { - sla = this.responseText; + sla = JSON.parse(this.responseText); + sla = sla[0]; } }; -xhttp.open("GET", "sla.json", false); -xhttp.send(); +xmlhttp.open("GET", "sla.json", false); +xmlhttp.send(); // Charts colors const chartColors = [