Documentation

Name Type Description Example
rowFields Array(Of String) The columns from the data file that should be displayed as rows in the pivot table. 'rowFields' => array('Product' => array(), 'Store' => array())
dataFields Array(Of String) The columns from the data file that should be used to aggregaten. The format option must be a valid excel format. A valid pivot_function: Sum, Count, Max, Min or Average. 'dataFields' => array('Product' => array('format' => '#,##0', 'pivot_function' => 'Count'))
columnFields Array(Of String) The columns from the data file that should be displayed in columns of the resulting pivot. 'columnFields' => array('Store' => array('sort' => 'Ascending'))
pageFields Array(Of String) The columns from the data file that will be used to generate filter values at the top of the pivot table. 'pageFields' => array('Store' => array(), 'Product' => array())
chart Array(Of String) Definition of the chart element containing
  • chart_type - currently only ColumnStacked and Pie are supported
  • title - The title of the chart
  • dataTable - yes if a data table should be displayed for the chart
'chart' => array('chart_type' => 'ColumnStacked', 'title' => 'Sales', 'dataTable' => 'yes')
file_type String Which type of file will be used as data file (*.csv or *.xlsx). 'file_type' => 'csv'

Complete example

$options = array (
'rowFields' => array('Product' => array(), 'Store' => array()),
'dataFields' => array('Product' => array('format' => '#,##0', 'pivot_function' => 'Count')),
'columnFields' => array('Store' => array('sort' => 'Ascending')),
'pageFields' => array('Store' => array(), 'Product' => array()),
'chart' => array('chart_type' => 'ColumnStacked', 'title' => 'Sales', 'dataTable' => 'yes'),
'file_type' => 'csv'
);