Column chart

Integration with Highcharts

by Dongor7

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: true,
  report: {
    dataSource: {
     dataSourceType: "json",
      data: getData()
    },
    slice: {
      rows: [{
        uniqueName: "Country"
      }],
      columns: [{
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "Price"
      }]
    },
    options: {
      viewType: "grid",
    }
  },
  height: 400,
  reportcomplete: function() {
    pivot.off("reportcomplete");
    createChart();
  }
});

function createChart() {
  pivot.highcharts.getData({
      type: "column",
    },
    function(chartConfig) {
      Highcharts.chart('highcharts-container', chartConfig);
    },
    function(chartConfig) {
      Highcharts.chart('highcharts-container', chartConfig);
    }
  );
}

function getData() {
  return [{
    "Country": "Australia",
    "Price": 445,
  }]
}