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>
<script src="https://cdn.flexmonster.com/lib/flexmonster.highcharts.js"></script>

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>

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

JavaScript

var pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  licenseFilePath: "https://cdn.flexmonster.com/jsfiddle.charts.key",
  toolbar: false,
  report: {
    dataSource: {
      data: getData()
    },
    slice: {
    	rows: [{
      	uniqueName: "Country"
      }],
      measures: [{
      	uniqueName: "Employee number"
      }]
    }
  },
  height: 250,
  reportcomplete: function() {
    pivot.off("reportcomplete");
    createChart();
  }
});

function createChart() {
  pivot.highcharts.getData({
      type: "line"
    },
    function(data) {
      data.yAxis[0].allowDecimals = false;
      console.log(data);
      Highcharts.chart('highcharts-container', data);
    },
    function(data) {
      data.yAxis[0].allowDecimals = false;
      Highcharts.chart('highcharts-container', data);
    }
  );
}

function getData() {
  return [{
      "Country": "The United States of America (USA), commonly known as the United States (U.S. or US) or simply America",
      "Department": "Department A",
      "Employee number": 1
    },
    {
      "Country": "Canada is a country in the northern part of North America. Its ten provinces and three territories extend from the Atlantic to the Pacific and northward into the Arctic Ocean.",
      "Department": "Department B",
      "Employee number": 2
    }
  ]
}