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

const pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    "dataSource": {
      "data": getData()
    },
    "slice": {
        "rows": [
            {
                "uniqueName": "Raw_material"
            },
            {
                "uniqueName": "[Measures]"
            }
        ],
        "columns": [
            {
                "uniqueName": "Analysis"
            }
        ],
        "measures": [
            {
                "uniqueName": "Price",
                "aggregation": "stdevp"
            },
            {
                "uniqueName": "Average",
                "formula": "average(\"Price\") ",
                "caption": "Average"
            },
            {
                "uniqueName": "Standard Deviation",
                "formula": "stdevp(\"Price\") ",
                "caption": "Standard Deviation"
            },
            {
                "uniqueName": "Coefficient of Variation",
                "formula": "stdevp(\"Price\") / average(\"Price\") ",
                "caption": "Coefficient of Variation",
                "format": "32v30m1y"
            }
        ]
    },
    "options": {
        "grid": {
            "showTotals": "off",
            "showGrandTotals": "off"
        }
    },
    "formats": [
        {
            "name": "32v30m1y",
            "decimalPlaces": 2,
            "currencySymbol": "%",
            "currencySymbolAlign": "right"
        }
    ]
  },
  width: "100%",
  height: 370
});

function getData() {
  return [{
  	"Raw_material": "Wheat",
    "Analysis": "AME",
    "Price": 1990
  }, {
  	"Raw_material": "Wheat",
    "Analysis": "STDAA",
    "Price": 1000
  }, {
  	"Raw_material": "Wheat",
    "Analysis": "AME",
    "Price": 1064
  }, {
  	"Raw_material": "Wheat",
    "Analysis": "STDAA",
    "Price": 18514
  }
  ];
}