JSFiddle - React, Tailwind, and code Playground

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div id="pivot-container"></div>

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      data: [{
        Color: "green",
        Quantity: 5
      }, {
        Color: "yellow",
        Quantity: 20
      }, {
        Color: "red",
        Quantity: 35
      }]
    },
    conditions: [{
        formula: "#value >= 30",
        format: {
          backgroundColor: "red"
        }
      },
      {
        formula: "AND(#value >= 10, #value < 30)",
        format: {
          backgroundColor: "yellow"
        }
      },
      {
        formula: "#value < 10",
        format: {
          backgroundColor: "green"
        }
      }
    ],
  }
});