I'm using zingchart gauges in my code. My problem is that I can't change the gauge value dynamically.
I'm getting this error:
Cannot set property 'values' of undefined
I'm using flask API. How can I change this variable value with flask API? Do you have any idea what can I use for dynamic gauge?
function fetchData() {
$.ajax({
url: "api/read",
method: "GET",
success: function(data, status, xhr) {
//var array = data.split(",").map(Number);
a = JSON.parse(data);
$('#myChart').series.values = 20;
//console.log(a);
},
error: function(xhr, status, error) {
$("#dataHeader").html("Error: \n" + error);
}
});
}
var myConfig4 = {
"type": "gauge",
"scale-r": {
"aperture": 200,
"values": "0:100:10",
"center": { //Pivot Point
"size": 6,
"background-color": "#66CCFF #FFCCFF",
"border-color": "#000000"
}
},
"plot": {
"csize": "5%",
"size": "85%",
"background-color": "#000000"
},
"series": [{
"values": [] // i need to change this value
}]
};
zingchart.render({
id: 'myChart',
data: myConfig4,
height: "75%",
width: "75%"
});
setInterval(fetchData, 1000);