JSFiddle - React, Tailwind, and code Playground

Demos

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

new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  height: 600,
  toolbar: true,
  report: {
    dataSource: {
      type: "elasticsearch",
      node: "https://olap.flexmonster.com:9200",
      index: "fm-foodprices",
    },
    slice: {
      columns: [
        {
          uniqueName: "Year",
        },
        {
          uniqueName: "Month",
        },
      ],
      measures: [
        {
          aggregation: "sum",
          uniqueName: "Price",
          format: "currency",
        },
      ],
      rows: [
        {
          uniqueName: "Country.keyword",
        },
        {
          uniqueName: "[Measures]",
        },
      ],
    },
    formats: [
      {
        name: "currency",
        currencySymbol: " $",
        decimalPlaces: 2,
        positiveCurrencyFormat: "1$",
        negativeCurrencyFormat: "-1$",
      },
    ],
  },
})