So I have an array object variable with this structure
var array_obj = [
{
Gooble: 240,
year: 2018
},
{
Koolle: 220,
year: 2018
}
{
Zooae: 220,
year: 2015
}
];
But I want to follow this structure instead https://www.amcharts.com/demos/stacked-column-chart
So now it should be
var array_obj = [
{
Gooble: 240,
Koolle: 220,
year: 2018
},
{
Zooae: 220,
year: 2015
}
];
I've been trying to this with this loop but I can't seem to do it properly.
for(var i in array_obj){
if(array_obj[i].year == array_obj[i].year){
# Push here
}
}
[{ year: 2018, entries: [{ name: 'Zooae', value: 220 }, ...] }, ...]or similar?