Below is the structure of my data:
let information = [
{
X:[
{title: 'Example1', quantity: 25},
{title: 'Example2', quantity: 35}
],
Y:[
{title: 'Sample3', quantity: 45},
{title: 'Sample4', quantity: 55}
]
},
{
X:[
{title: 'Example1', quantity: 250},
{title: 'Example2', quantity: 350}
],
Y:[
{title: 'Sample3', quantity: 450},
{title: 'Sample4', quantity: 550}
]}
]
This is how I want to reorganize my data: https://i.sstatic.net/PSHni.png
You can see the array structure in JSFiddle here: https://jsfiddle.net/rj5e38v9/3/