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>
<div class="output" id="output">Output will appear here</div>
CSS
.output {
width: 80%;
height: 300px;
margin-left: auto;
margin-right: auto;
padding: 20px;
background: rgba(242, 242, 242, 1);
font-family: Menlo, Monaco, "Courier New", Courier, monospace;
white-space: pre;
font-size: 16px;
font-weight: 400;
overflow-y: scroll;
margin-top: 20px;
}
JavaScript
let pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: getData(),
mapping: {
'id': {
type: 'id'
},
'record_type': {
type: 'property',
hierarchy: 'title'
},
'date_start_flex': {
type: 'year/month/day',
dimensionUniqueName: 'Dates',
caption: 'Date'
},
'date_stop_flex': {
type: 'year/month/day',
dimensionUniqueName: 'Dates',
caption: 'Stop'
},
'start': {
type: 'datetime',
dimensionUniqueName: 'Dates',
caption: 'Timestamp Start'
},
'stop': {
type: 'datetime',
dimensionUniqueName: 'Dates',
caption: 'Timestamp Stop'
},
'Date Last': {
type: 'year/month/day',
dimensionUniqueName: 'Dates',
caption: 'Last'
},
'Date Created': {
type: 'year/month/day',
dimensionUniqueName: 'Dates',
caption: 'Created'
},
'Time Start': {
type: 'time',
dimensionUniqueName: 'Times',
caption: 'Time Start'
},
'Time Stop': {
type: 'time',
dimensionUniqueName: 'Times',
caption: 'Time Stop'
},
'Time Total': {
type: 'time',
dimensionUniqueName: 'Times',
caption: 'Time Total'
},
'Time Type': {
type: 'string',
caption: 'Time Type'
},
'Employee': {
type: 'string',
caption: 'Employee Name'
},
'Project': {
type: 'string',
caption: 'Project Title'
},
'Account Name': {
type: 'string',
caption: 'Account Name'
},
'Type': {
type: 'string',
caption: 'Type'
...