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="pivot-container"></div>

JavaScript

var pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 430,
  toolbar: true,
  report: {
    dataSource: {
      dataSourceType: "json",
      data: [{
          "date": {
            "type": "date string"
          },
          "product": {
            "type": "string"
          },
          "n": {
            "type": "number"
          }
        },
        {
          "date": "2020-04-06T23:59:30",
          "product": "apple",
          "n": 1
        },
        {
          "date": "2020-04-07T23:59:30",
          "product": "orange",
          "n": 1
        },
        {
          "date": "2020-02-08T20:33",
          "product": "pear",
          "n": 1
        }
      ]
    },
    options: {
      datePattern: "MM/dd/yyyy",
      showEmptyValues: true
    },
    slice: {
      rows: [{
        uniqueName: "product",
        "filter": {
          "exclude": [
            "product.[apple]"
          ]
        }
      }],
      columns: [{
        uniqueName: "date"
      }, {
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "n"
      }],
    }
  }
});