Menu
Free Trials
Table of contents

Options

The way how Pivot Component looks can be defined within the report. Options are used to specify appearance and functionality available for customers. Default options are set for every pivot instance. Specific options can be defined in addition to default ones. Find more details in the following sections:

Options properties

With options you can define Fields List mode, enable/disable drill through, showing of default slice, sorting, editing, define grid and chart properties. Here is a list of all available properties for options:

  • viewType – String. Type of view to show: "grid" or "charts" or "grid_charts" (starting from v1.9).
  • grid – Object. Contains information about grid:
    • type – String. Selected grid type. The following chart types are supported: "compact", "classic" and "flat".
    • title – String. Title of the grid.
    • showFilter – Boolean. Indicates whether the opening columns/rows filter controls and page filter controls are visible (true) or not (false) on the grid. Default value is true.
    • showHeaders – Boolean. Indicates whether the spreadsheet headers are visible (true) or not (false).
    • fitGridlines – Boolean. Indicates whether the gridlines are shown for all cells (false) or only non-empty (true).
    • showTotals – Boolean. Indicates whether the totals are visible (true) or not (false).
    • showGrandTotals – String. Specifies how to show grand totals: in rows ("rows"), in columns ("columns"), in rows and columns ("on") or hide them ("off"). Default value is "on".
    • showHierarchies – Boolean. Specifies how to show drillable hierarchy cells on the grid: with link on the right (true) or with icon on the left (false). Default value is true.
    • showHierarchyCaptions – Boolean. Indicates whether the hierarchy captions are visible (true) or not (false) on the grid. Default value is true.
    • showReportFiltersArea (starting from v2.2) – Boolean. Indicates whether the reports filtering cells on the grid should be visible (true) or not (false). Default value is true.
    • pagesFilterLayout (starting from v2.3) – String. Allows to choose the layout for the report filters. Possible values: "horizontal" and "vertical". Default value is "horizontal".
  • chart – Object. Contains information about charts:
    • type – String. Selected chart type. The following chart types are supported: "bar", "line", "scatter", "pie", "bar_stack" and "bar_line" (starting from v1.9).
    • title – String. Title of the chart.
    • showFilter (starting from v2.2) – Boolean. Indicates whether the opening columns and rows filter controls are visible (true) or not (false) on the charts. Default value is true.
    • multipleMeasures – Boolean. Starting from v1.9. Indicates whether to show multiple measures on charts. Default value is false.
    • oneLevel (starting from v2.1) – Boolean. In case of drillable chart, defines whether chart shows elements only for the lowest hierarchy (true). Default value is false. Bar, Line, Scatter, Bar stack and Bar line charts support this feature.
    • autoRange – Boolean. Indicates whether the range of values on the charts is selected automatically or not.
    • showLegendButton (starting from v2.2) – Boolean. Indicates whether the button to show/hide the legend on charts is visible. Default value is false which means that the legend is always visible, without the button that hides it.
    • showAllLabels – Boolean. Setting a value to true allows showing all the labels in Pie сhart. If the value is false it will have the same behavior as it was before. Default value is false.
    • showMeasures (starting from v2.2) – Boolean. Hides all dropdowns on the top of charts if you want to show simple chart without controls or you want to save space. Default value is true – the dropdowns are visible by default, as it was in previous versions.
    • showOneMeasureSelection – Boolean. The default value is true, which means that the visibility of the measures dropdown on charts does not depend on the amount of measures in it. If the value is set to false, the measures dropdown on charts will be hidden if there is only one measure in the list and visible if there are two or more measures.
    • showWarning – Boolean. Indicates whether the warning are shown if data is too big for charts.
    • activeMeasure – String. Selected measure on charts view.
    • activeTupleIndex – Number. Selected tuple index on the Pie chart.
  • configuratorActive – Boolean. Indicates whether the Fields List is opened (true) or closed (false).
  • configuratorButton – Boolean. Indicates whether the Fields List toggle button is visible (true) or not (false).
  • configuratorMatchHeight (starting from v2.1) – Boolean. Indicates whether the Fields List will be the same height as the component (true) or it’s height will be defined by its content amount (false). Default value is false.
  • showAggregations (starting from v2.0) – Boolean. Indicates whether the aggregation selection control is visible (true) or not (false) for measures on Fields List. Default value is true.
  • showCalculatedValuesButton (starting from v2.2) – Boolean. Controls the visibility of “Add calculated value” in Fields List. Default value is true.
  • editing (starting from v2.1) – Boolean. Indicates whether the editing feature is enabled (true) or disabled (false) on the Drill Through popup for CSV and JSON data sources. User will be able to double-click the cell and enter new value in it if the editing feature is enabled.
  • drillThrough (starting from v2.1) – Boolean. Indicates whether the drill through feature is enabled (true) or disabled (false). User can drill through by double-clicking the cell with value. Drill through feature is available for all data sources except icCube. Default value is true.
  • showDrillThroughConfigurator – Boolean. Indicates whether the Fields List toggle button is visible in Drill Through view. Default value is true.
  • sorting (starting from v2.0) – String. Indicates whether the sorting controls are visible in rows ("rows"), in columns ("columns"), in rows and columns ("on" or true) on the grid cells or not visible ("off" or false). Default value is "on".
  • datePattern – String. It is used to format “date string” date fields ("type":"date string" in JSON, "ds+" prefix in CSV). A default pattern string is dd/MM/yyyy.
  • dateTimePattern – String. It is used to format “datetime” date fields ("type":"datetime" in JSON, "dt+" prefix in CSV). A default pattern string is dd/MM/yyyy HH:mm:ss.
  • saveAllFormats – Boolean. If there are more than 5 formats defined, only the formats that are used for "active=true" measures will be saved in the report. In order to get saved all the formats, no matter how many of them you have and whether they are used for active measures or not, please set saveAllFormats property to true. Default value is false.
  • showDefaultSlice (starting from v2.2) – Boolean. Defines whether the component selects a default slice for the report with empty slice (when nothing is set in rows, columns, pages and measures). If true, the first hierarchy from data goes to rows and the first measure goes to columns in the default slice. To avoid this default behavior, please set this property to false. Default value is true. Only for "csv", "ocsv" and "json" data source types.
  • showEmptyData – Boolean. If you have an empty CSV data source, but the header is defined and you want the Pivot to show it so, you can set showEmptyData as true and it will show your slice with empty data cells. The default value is false – the Component shows the “Data source is empty. Please check the CSV file.” message.
  • defaultHierarchySortName (starting from v2.0) – String. Sorting type for hierarchies’ members ("asc", "desc" or "unsorted"). Default value is "asc".
  • selectEmptyCells (starting from v2.3) – Boolean. Indicates whether it is possible to select cells outside of the table. Default value is true.
  • showMemberProperties (starting from v2.1) – Boolean. Indicates whether the member properties for OLAP data source are visible (true) or not (false) on Fields List. Default value is false.
  • showOutdatedDataAlert – Boolean. Setting a value to true will show the warning to the user before automatic reloading of data from the cube. Default value is false which means there will be no warnings. Only for Flexmonster Accelerator.

Default options

In case options were not defined in the report, Pivot Component will use global options, if they are defined, or defaults from the component. These options can be overridden in the report. Below is an example of default options. Please note, you have to specify only necessary options. The rest will be defined automatically by the component instance.

{
   "dataSource": {
        "filename": "http://www.flexmonster.com/download/data.csv"
    },
    "options": {
        "viewType": "grid",
        "grid": {
            "type": "compact",
            "title": "",
            "showFilter": true,
            "showHeaders": true,
            "fitGridlines": false,
            "showTotals": true,
            "showGrandTotals": "on",
            "showExtraTotalLabels": false,
            "showHierarchies": true,
            "showHierarchyCaptions": true,
            "showReportFiltersArea": true,
            "pagesFilterLayout": "horizontal"
        },
        "chart": {
            "type": "bar",
            "title": "",
            "showFilter": true,
            "multipleMeasures": false,
            "oneLevel": false,
            "autoRange": false,
            "reversedAxes": false,
            "showLegendButton": false,
            "showAllLabels": false,
            "showMeasures": true,
            "showOneMeasureSelection": true,
            "showWarning": true,
            "activeMeasure": ""
        },
        "configuratorActive": true,
        "configuratorButton": true,
        "configuratorMatchHeight": false,
        "showAggregations": true,
        "showCalculatedValuesButton": true,
        "editing": false,
        "drillThrough": true,
        "showDrillThroughConfigurator": true,
        "sorting": "on",
        "datePattern": "dd/MM/yyyy",
        "dateTimePattern": "dd/MM/yyyy HH:mm:ss",
        "saveAllFormats": false,
        "showDefaultSlice": true,
        "showEmptyData": false,
        "defaultHierarchySortName": "asc",
        "selectEmptyCells": true,
        "showOutdatedDataAlert": false
    }
}

Grid options

All grid options are combined in grid section of options object. Here you can specify just the necessary properties. This example shows how to set title and hide totals from the grid:

{
    "dataSource": {
        "filename": "http://www.flexmonster.com/download/data.csv"
    },
    "options": {
        "grid": {
            "title": "Results",
            "showTotals": false
        }
    }
}

Chart options

All chart options are combined in chart section of options object. The following example will set chart title, type and active measure. Please note, viewType is set to charts to see the result instantly:

{
    "dataSource": {
        "filename": "http://www.flexmonster.com/download/data.csv"
    },
    "options": {
        "viewType": "charts",
        "chart": {
            "type": "scatter",
            "title": "Summary chart",
            "activeMeasure": "Quantity"
        }
    }
}

Change options using Toolbar

Please use Options in Toolbar to change grand totals, subtotals and table layout in run time.

options

You can change options among with other report parts using API call setReport(). Also options can be changed separately via setOptions(). To see the current options use getOptions().