Created
March 10, 2015 19:46
-
-
Save jackcompton/86d748edd84b16036cb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//data option 1 | |
// hierarchy is native to the representation | |
data = [{name: "Country", | |
value: "Chile", | |
children: [{name: "series", | |
value: "Adult Literacy", | |
columns: [{name: "2001", value: "23"}, {name: "2002", value: "29"}] | |
}, | |
{name: "series", | |
value: "Fully Vaccinated", | |
columns: [{name: "2001", value: "12"}, {name: "2002", value: "15"}] | |
}] | |
}] | |
//data option 2: | |
// data itself is stored hierarchy agnostic. hierarchical grouping (if needed) must be provided separately | |
data = [ | |
[{dimensions: {"Country": "Chile", "Series": "Adult Literacy", "Year": 2001}, value: 23}, | |
{dimensions: {"Country": "Chile", "Series": "Adult Literacy", "Year": 2002}, value: 29}, | |
{dimensions: {"Country": "Chile", "Series": "Fully Vaccinated", "Year": 2001}, value: 12}, | |
{dimensions: {"Country": "Chile", "Series": "Fully Vaccinated", "Year": 2002}, value: 15}] | |
] | |
structure = {rows: ["Country", "Series"], columns: "Year"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment