I'm getting an array in the variable "myObj" ([00, 12, 45, 34, 23, 34, 34, 34, 05, 42, 21, 11, 31]). And I needed to put this value in the series, ie replace the array that is there hardcoded. Type: series = [myObj, ...]
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText); // Valor que tenho
}
};
xmlhttp.open("GET", "api/api_get_fogo.php", true);
xmlhttp.send();
var dataSales = {
labels: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
series: [
[00, 12, 45, 34, 23, 34, 34, 34, 05, 42, 21, 11, 31], // Onde quero substituir
[00, 24, 36, 03, 34, 10, 15, 20, 48, 19, 49, 32, 02]
]
};