I have a collection of objects structured like this:
all_data = [
{
title: "Hello",
slices: {
A: 50,
B: 70,
C: 40
}
},
{
title: "Goodbye",
slices: {
A: 100,
B: 80,
C: 50
}
},
{
title: "My title",
slices: {
A: 100,
B: 80,
C: 50,
D: 200
}
},
//continue.. ]
How can I divide these data sets into n
groups with rectangles scaled accordingly to match the slice values? Despite my attempts so far, I'm at a standstill and need guidance.
d3.select("body")
.append("svg")
.data(all_data)
.enter()
.append("g")
.whatDoIDo()
I am struggling to figure out how to expand each item in the data structure to include multiple rectangle tags based on certain criteria.