Member properties in JSON
Data source
by Dongor7
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<h3>
Click 'Banana cake' cell to see its product ID
</h3>
<div id="pivot-container"></div>
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
toolbar: true,
report: {
dataSource: {
data: getData()
},
slice: {
rows: [{uniqueName: "product"}],
columns: [{uniqueName: "[Measures]"}],
measures: [{uniqueName: "price"}]
}
},
});
function getData() {
return [{
"product": {
type: "date"
},
"productID":{
type: "property",
hierarchy: "product"
},
"price": {
type: "number"
}
},
{
"product" : "10/10/2020",
"productID" : "0816",
"price" : 24
},
{
"product" : "Chocolate",
"productID" : "2626",
"price" : 31
},
{
"product" : "Chocolate",
"productID" : "2626",
"price" : 56
}];
}