{
await Promises.delay(5000);
do {
const newValue = Math.floor(Math.random() * 4);
console.log(newValue);
const faoData = faoprojections2050median.filter(function(d) {
if (d.Year === year[newValue] && d.Item == "Raising of pigs") {
return d;
}
});
yield faoData;
await barchart.update(faoData).end();
await Promises.delay(1300);
} while (true);
}