I'm attempting to pass the following data structure into D3, specifically the pie layout.
var myData = {
myValue : "foo",
myArray : [
{animal : "cat", noise : "meow", cost : 200},
{animal : "dog", noise : "woof", cost : 300}
]
}
I am unable to pass the array portion into d3 using dot notation, for example:
//Passing of data to pie omitted
var pie = d3.layout.pie()
.value(function(d){
return d.myArray.cost;
});
Can someone supply a bl.ocks example or tutorial that works with this use case?