Flexmonster - Load CSV file
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://s3.amazonaws.com/flexmonster/2.3/flexmonster.js"></script>
<div id="pivot-container"></div>
JavaScript
var jsonData = [
{
"Color": {type: "string"},
"Country":{type: "level", hierarchy: "Geography",
level: "Country"},
"State": {type: "level", hierarchy: "Geography",
level: "State", parent: "Country"},
"City": {type: "level", hierarchy: "Geography",
parent: "State"},
"Price": {type: "number"},
"Quantity": {type: "number"}
},
{
"Color" : "green",
"Country" : "Canada",
"State" : "Ontario",
"City" : "Toronto",
"Price" : 174,
"Quantity" : 22
},
{
"Color" : "red",
"Country" : "USA",
"State" : "California",
"City" : "Los Angeles",
"Price" : 166,
"Quantity" : 19
}
];
var pivot = $("#pivot-container").flexmonster({
toolbar: true,
report: {
dataSource: {
data: jsonData
},
slice: {
columns: [
{ uniqueName: "Color" },
{ uniqueName: "[Measures]" }
],
rows: [
{ uniqueName: "Geography" }
],
measures: [
{ uniqueName: "Price" }
]
}
},
width: "100%",
height: 400,
componentFolder: "https://s3.amazonaws.com/flexmonster/2.3/"
});