Empty values in JSON
Data source
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
CSS
@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
toolbar: true,
report: {
dataSource: {
dataSourceType: "json",
data: getData()
},
slice: {
rows: [{
uniqueName: "Color"
}],
columns: [{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Price"
}, {
uniqueName: "Quantity"
}]
}
}
});
function getData() {
return [{
"Color": "green",
"M": "September",
"W": "Wed",
"Time": "2145",
"country": "Canada",
"state": "Ontario",
"city": "Toronto",
"Price": 174,
"Quantity": 22
}, {
"Color": "red",
"M": "March",
"W": "Mon",
"Time": "1000",
"country": "USA",
"state": "California",
"city": "Los Angeles",
"Price": "",
"Quantity": 35
},
{
"Color": "blue",
"M": "April",
"W": "Wed",
"Time": "2345",
"country": "USA",
"state": "California",
"city": "Los Angeles",
"Price": null,
"Quantity": 219
},
{
"Color": "pink",
"M": "March",
"W": "Tue",
"Time": "2356",
"country": "USA",
"state": "California",
"city": "Los Angeles",
"Quantity": 55
}
];
}