I have this JSON data structure:
[
{ \"dep\": \"d1\", \"name\": \"name1\", \"size\": \"size1\" },
{ \"dep\": \"d1\", \"name\": \"name2\", \"size\": \
Hey guys I think I found a fairly simple solution. I accomplished a very nice nesting of a large dataset (400,000 rows) for a hierarchical bar chart in a very streamline way. It utilizes the Underscore library and an additional function _.nest
. Simply download and include the two libraries necessary
src="underscore-min.js"
src="underscore.nest.js"
Then use the _.nest
function to create your structure. Here's my line:
var newdata = _.nest(data, ["Material", "StudyName"]);
"Material"
and "StudyName"
are the columns I want to group my structure to.
There are other options to use this function if you need to accomplish more things but I will leave it like this