After constructing this bar chart in D3, which can be accessed here(http://jsfiddle.net/YQthy/), I am looking to substitute the random data with information from a JSON database.
{
"description" : "Cheese, caraway",
"group" : "Dairy and Egg Products",
"id" : 1008,
"manufacturer" : "",
"nutrients" : [
{
"description" : "Protein",
"group" : "Composition",
"units" : "g",
"value" : 25.18
},
...
],
"portions" : [
{
"amount" : 1,
"grams" : 28.35,
"unit" : "oz"
}
],
"tags" : []
}
The plan is for the parent node's value (cheese, Caraway) to become a variable obtained through a drop down selection. Subsequently, the child node description will serve as the label, and the "value" attribute will be used as the data.