I need to create a combination of arrays.
I have the data like this and I need to arrange the data for the chart series
[
{
"movingDuration":10,
"parkedDuration":15,
},
{
"movingDuration":15,
"parkedDuration":23,
},
{
"movingDuration":43,
"parkedDuration":26,
},
{
"movingDuration":67,
"parkedDuration":21,
},
{
"movingDuration":47,
"parkedDuration":54,
}
]
and I expected a result like this the following method
[
{
"name":"Moving Duration",
"data":[
10,
15,
43,
67,
47
]
},
{
"name":"Parked Duration",
"data":[
15,
23,
26,
21,
54
]
}
]
Any help would be appreciated. thank you