Hiding fields in CSV

Mapping configuration

by Flexmonster Pivot Table

HTML

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

<div>
  <p>
    In this example, we hide the <code>"Country"</code> field by setting the
    <a
      href="https://www.flexmonster.com/api/field-mapping-object/#visible"
      target="_blank"
    >visible</a> property to <code>false</code> (line 10 in the Javascript box).
  </p>
  <p>
    As a result, althought the <code>"Country"</code> is included in the slice
    (line 22 in the Javascript box), the field is not visible on the grid, charts,
    and in the Field List.
  </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/",
  toolbar: true,
  report: {
    dataSource: {
      filename: "data/data.csv",
      mapping: {
        "Country": {
          visible: false
        }
      }
    },
    slice: {
      rows: [
        {
          uniqueName: "Color"
        }
      ],
      columns: [
        {
          uniqueName: "Country"
        },
        {
          uniqueName: "[Measures]"
        }
      ],
      measures: [{
        uniqueName: "Price",
        aggregation: "sum"
      }]
    },
    options: {
      configuratorActive: true
    }
  }
});