Flexmonster - Load JSON

Demos

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

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

JavaScript

var pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  report: {
    dataSource: {
      dataSourceType: "json",
      data: getData()
    },
    slice: {
      rows: [{
        uniqueName: "group"
      }],
      columns: [{
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "amount",
        aggregation: "max"
      }],
    }
  }
});

function getData() {
  return [{
      "group": {
        "caption": "Group",
        "type": "string"
      },
      "amount": {
        "caption": "Amount",
        "type": "number"
      },
    },
    [
      "TEST1",
      -1234.56
    ],
    [
      "TEST2",
      -9000.99
    ]
  ];
}