I am currently working on creating a pie chart that displays the distribution of collections based on their names. I have come across an issue where d3.layout.pie().value() only evaluates specified array values. Is there a solution available to extract the size of values from JSON data? For example,
[
{
"name": "json",
"Lead":
[
{"a": "aaa"},
{"b": "bbb"},
{"c": "ccc"},
{"d": "ddd"}
],
"Costs":
[
{
"actual": "222"
},
{
"plan": "333"
}
],
"Budget":
[
{
"actual": "111"
},
{
"plan": "333"
}
]
}
]
Therefore, the data that needs to be mapped for the value would be [4, 4, 2]