SliceObject

The SliceObject defines which fields from the data source will be displayed on the grid.

Properties

Property/TypeDescription
fieldsFieldObject[]optionalA list of fields selected for display on the flat table.
columnsFieldObject[]optionalA list of fields selected for columns on the pivot table.
rowsFieldObject[]optionalA list of fields selected for rows on the pivot table.
valuesValueObject[]optionalA list of fields selected for values on the pivot table.

Examples

  1. Define a slice for the flat table:
const state = {
  id: "state-0",
  dataset: dataset,
  slice: {
    fields: [
      {
        name: "Country",
        aggregation: "sum"
      },
      {
        name: "Category",
        aggregation: "distinct_count"
      },
      {
        name: "Price",
        aggregation: "average",
        showTotal: false
      }
    ]
  }
};
  1. Define a slice for the pivot table:
const state = {
  id: "state-0",
  dataset: dataset,
  slice: {
    rows: [
      {
        name: "Country"
      },
      {
        name: "Destination"
      }
    ],
    columns: [
      {
        name: "Color"
      },
      {
        name: "Category"
      }
    ],
    values: [
      {
        name: "Price",
        aggregation: "average",
        showTotal: false
      }
    ]
  }
};