I'm currently diving into the world of d3.js and aiming to develop a visualization similar to the example image I've attached in the link below.
http://jsfiddle.net/mike_ellan/37PYJ/
While I have a good grasp on creating and binding text elements, I am facing some challenges when it comes to working with this specific data structure. Unfortunately, I do not have the flexibility to request a different JSON format, so I need to figure out how to map it effectively. Here is the initial data:
var consumption = [
{
"fruits": [
{
"year":"2011",
"apples":"213",
"oranges":"176",
"pears":"987"
},
{
"year":"2012",
"apples":"199",
"oranges":"234",
"pears":"672"
}
]
}
];
My strategy for handling the years is to create a two-row/column table and dynamically add columns for each year based on the JSON data. Any insights or tips on how I can approach this task would be greatly appreciated!