Data types in JSON
Data source
by Flexmonster Pivot Table
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
JavaScript
var jsonData = [
{
"Bikes":{type: "level", hierarchy: "Bikes",
level: "Bikes"},
"Type": {type: "level", hierarchy: "Bikes",
level: "Type", parent: "Bikes"},
"Price": {type: "number"},
"Quantity": {type: "number"}
},
{
"Bikes" : "Bikes",
"Type" : "Mountain bikes",
"Price" : 174,
"Quantity" : 22
},
{
"Bikes" : "Bikes",
"Type" : "Touring bikes",
"Price" : 166,
"Quantity" : 19
}
];
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
report: {
dataSource: {
data: jsonData
},
slice: {
rows: [
{ uniqueName: "[Measures]" }
],
columns: [
{ uniqueName: "Bikes" }
],
measures: [
{ uniqueName: "Price"}
]
}
}
});