Running Totals

Global object

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/",
  width: "100%",
  height: 430,
  toolbar: true,
  report: {
    dataSource: {
      data: getData()
    },
    slice: {
      rows: [{
        "uniqueName": "Country"
      }],
      columns: [{
        "uniqueName": "Date"
      }],
      measures: [{
        uniqueName: "Growth",
        "aggregation": "runningtotalsofrow"
      }]
    }
  }
});

function getData() {
  return [{
      "Growth": {
        type: "number"
      },
      "Country": {
        type: "string"
      },
      "Date": {
        type: "date string"
      }
    },
    {
      "Growth": 1,
      "Country": "FR",
      "Date": "2012-05-06"
    },
    {
      "Growth": 1,
      "Country": "BE",
      "Date": "2012-05-06"
    },
    {
      "Growth": 1,
      "Country": "UK",
      "Date": "2012-05-06"
    },
    {
      "Growth": 1,
      "Country": "FR",
      "Date": "2012-05-07"
    },
    {
      "Growth": 1,
      "Country": "UK",
      "Date": "2012-05-07"
    },
    {
      "Growth": 1,
      "Country": "BE",
      "Date": "2012-05-08"
    },
    {
      "Growth": 1,
      "Country": "UK",
      "Date": "2012-05-08"
    },
    {
      "Growth": 1,
      "Country": "FR",
      "Date": "2012-05-09"
    },
    {
      "Growth": 1,
      "Country": "UK",
      "Date": "2012-05-09"
    },
  ];
}