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>

CSS

#fm-fields-view {
  top: -70px !important;
  height: 360px;
}

#fm-pivot-view #fm-fields-view .fm-popup-content .fm-ui-col-3 {
  height: 200px !important;
}

JavaScript

var pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      data: getData()
    },
    slice: {
      columns: [{
        uniqueName: '[Measures]'
      }],
      rows: [{
        uniqueName: 'Year'
      }],
      measures: [{
        uniqueName: 'Value'
      }]
    },
    options: {
      viewType: 'charts',
      chart: {
      	type: 'line'
      },
      grid: {
        showEmptyValues: true
      }
    }
  }
});

function getData() {
  return [{
      "Year": "2020",
      "Value": 20
    },
    {
      "Year": "2021",
      "Value": 21
    },
    {
      "Year": "2022"
    },
    {
      "Year": "2023"
    },
    {
      "Year": "2024",
      "Value": 26
    },
  ];
}