Flexmonster - Load JSON
Demos
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 pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
dataSourceType: "json",
data: getData()
},
slice: {
rows: [{
uniqueName: "sign"
}],
columns: [{
uniqueName: "country"
},{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "country",
aggregation: "count"
}],
}
}
});
function getData() {
return [{
"sign": {
"caption": "Sign",
"type": "string"
},
"country": {
"caption": "Country",
"type": "string"
},
},
[
"+Sign",
"FR"
],
[
"-Sign",
"FR"
],
[
"001",
"EN"
],
[
"ABC",
"EN"
]
];
}