Set the order of fields in the flat view

Configuring the slice

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

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

CSS

@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);

JavaScript

const pivot = new Flexmonster({
  container: '#pivot-container',
  componentFolder: 'https://cdn.flexmonster.com/',
  toolbar: true,
  report: {
    dataSource: {
      filename: 'data/sales.csv',
    },
    slice: {
      flatOrder: ['Month', 'Category', 'Customer', 'Payment Method', 'Revenue'],
      rows: [
        {
          uniqueName: 'Category',
        },
        {
          uniqueName: 'Customer',
        },
        {
          uniqueName: 'Payment Method',
        },
      ],
      columns: [
        {
          uniqueName: 'Month',
        },
        {
          uniqueName: '[Measures]',
        },
      ],
      measures: [
        {
          uniqueName: 'Revenue',
        },
      ],
    },
    options: {
      grid: {
        type: 'flat',
      },
    },
  },
})