2
I have the following javascript array:
for(var k in lista) {
for(var x in lista[k]){
var donutData = [
{label: x, data: lista[k][x], color: "#3c8dbc"}
];
}
}
At the end I would like the donutData variable to look like this:
var donutData = [
{label: "Series2", data: 30, color: "#3c8dbc"},
{label: "Series3", data: 20, color: "#F56954"},
{label: "Series4", data: 50, color: "#00A65A"},
{label: "Series4", data: 50, color: "#F39C12"},
{label: "Series4", data: 50, color: "#00C0EF"}
];
It is possible?
Without Saver the structure of
lista
it’s hard to help. Test like this: https://jsfiddle.net/cw890hwc/ if it doesn’t work it puts the structure oflista
in the question.– Sergio