Specify whether to show a default slice

Slice configuration

by Flexmonster Pivot Table

HTML

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

<div>
  <p>
    When the
    <a
      target="_blank"
      href="https://www.flexmonster.com/api/options-object/#showdefaultslice"
    >showDefaultSlice</a> option is set to <code>false</code> 
    (line 10 in the JavaScript box), the component does not set a
    <a target="_blank" href="https://www.flexmonster.com/doc/slice/#default"
    >default slice</a> for a report with an empty slice.
  </p>
  <p>
    Otherwise, the first field from data goes to rows and the first measure goes
    to columns.
  </p>
</div>

<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/",
  height: 300,
  report: {
    dataSource: {
      data: getData()
    },
    options: {
      showDefaultSlice: false
    }
  }
});

function getData() {
  return [{
      "Category": "Accessories",
      "Country": "Canada",
      "Price": 125,
      "Quantity": 100
    },
    {
      "Category": "Accessories",
      "Country": "France",
      "Price": 74,
      "Quantity": 235
    },
    {
      "Category": "Bikes",
      "Country": "USA",
      "Price": 233,
      "Quantity": 184
    }
  ]
}