var dataid=45;
listStations.push(data[i].ID);
$.getJSON("https://example.com/json?id=" + data[i].ID, function (parkDetay) {
var getCapacity = 100 - (Math.round((100 / parkDetay[0].capacity) * parkDetay[0].emptyCapacity));
nowCapacity = getCapacity;
console.log(dataid);
nearStations.push([dataid, nowCapacity, nowValue])
});
I give a constant value before the json parenthesis begins.
dataid = 45;
or a dynamic variable
dataid = data[i].ID;
Both of them do not print with console.log in JSON and return "0".
What to do? It does not push the series as an extra