Predefined slice for the drill-through view

Slice configuration

by Flexmonster Pivot Table

HTML

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

<div>
  <h2>How to predefine a slice for the drill-through view</h2>
  <p>
    To predefine a slice for the drill-through view, specify the needed fields
    in the
    <a
      href="https://www.flexmonster.com/api/slice-object/#drillthrough"
      target="_blank"
    >slice.drillThrough</a> array.
  </p>
  <p>
    In this example, the main slice contains two fields:
    <code>"Category"</code> and <code>"Price"</code>, while the slice in the
    drill-through view has four fields: <code>"Country"</code>,
    <code>"Category"</code>, <code>"Color"</code>, and <code>"Price"</code>. To
    see the configured drill-through slice, double-click a value on the grid.
  </p>
  <p>
    <a href="https://www.flexmonster.com/doc/slice/" target="_blank"
    >Refer to our documentation to learn more about slice configuration</a>.
  </p>
</div>

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

CSS

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

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 430,
  report: {
    dataSource: {
      filename: "https://cdn.flexmonster.com/data/data.csv",
    },
    slice: {
      drillThrough: [
        "Country", 
        "Category", 
        "Color", 
        "Price"
      ],
      rows: [
        {
          uniqueName: "Category",
        },
      ],
      columns: [
        {
          uniqueName: "[Measures]",
        },
      ],
      measures: [
        {
          uniqueName: "Price",
          aggregation: "sum",
        },
      ],
    },
  },
})