JSFiddle - React, Tailwind, and code Playground
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="pivotContainer"></div>
JavaScript
function LoadFlexmonster(vcred, vmap, vslice, vformat, vconditions) {
var var_cred = vcred;
var var_map = vmap;
var var_slice = vslice;
//added also format and condition objects
var var_format = vformat;
var var_conditions = vconditions;
var pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
height: 450,
toolbar: true,
report: {
dataSource: {
filename: "https://cdn.flexmonster.com/data/retail-data.json",
type: "json",
requestHeaders: {
'Authorization': var_cred
},
mapping: var_map
},
options: {
showAggregationLabels: false,
datePattern: "yyyy-MM-dd",
configuratorButton: false,
showFilter: true,
showReportFiltersArea: true,
showEmptyValues: false,
grid: {
"showHeaders": false
},
general: undefined,
chart: undefined
},
slice: var_slice,
formats: var_format,
conditions: var_conditions
}
});
}
LoadFlexmonster("znati 21521512454", {
"Date": {
type: "date string"
}
}, {
rows: [{
uniqueName: "Country"
}],
columns: [{
uniqueName: "Date"
}],
measures: [{
uniqueName: "Price",
aggregation: "average",
format: "currency"
}]
},
[{
name: "currency",
currencySymbol: "$"
}],
[{
formula: "#value > 0",
measure: "Price",
aggregation: "average",
format: {
backgroundColor: "#FFFFFF",
color: "#7CB342",
fontFamily: "Arial",
fontSize: "12px"
}
}], );