Column chart

Integration with Highcharts

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: true,
  report: {
    dataSource: {
      dataSourceType: "json",
      data: getData()
    },
    "slice": {
      "rows": [{
        "uniqueName": "Country"
      }],
      "columns": [{
        "uniqueName": "[Measures]"
      }],
      "measures": [{
          "uniqueName": "Formula #1",
          "formula": "sum(\"Price\") * 100",
          "caption": "Sum of Price",
          "format": "-11arwt36jmth00"
        },
        {
          "uniqueName": "Price",
          "aggregation": "sum",
          "active": false,
          "format": "-my6bcq8drvc00"
        }
      ]
    },
    "formats": [{
        "name": "-my6bcq8drvc00",
        "isPercent": true
      },
      {
        "name": "-11arwt36jmth00",
        "currencySymbol": "%",
        "positiveCurrencyFormat": "1$",
        "negativeCurrencyFormat": "-1$"
      }
    ]
  },
  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,
  }]
}