The jquery pivot grid allows visualization of multi-dimensional data and hierarchical data structures. It supports multiple different aggregation functions and developers can also provide
user-defined aggregations. The pivot grid for jQuery also ships with a pivot table designer widget. The pivot table designer allows you to visually configure the pivot columns, rows, aggregated values and multiple
different settings. You can also configure pivot rows and columns text alignment settings and various text formatting options on the pivot cells.
The jQuery pivot grid and the pivot designer
also allow the user to configure pivot table filters both programmatically and visually using drag and drop operations and filter selection options.
You can use the PivotGrid widget to add interactive pivot tables to your website, build custom dashboards, or use it in your mobile applications. The pivot grid widget offers excellent
cross-browser compatibility and works well with both desktop and mobile browsers.
Before you start with the Pivot Grid widget, you should be familiar with pivot tables and understand when to use regular data grids to display
table data, and when to switch to the pivot grid and pivot tables. The following article is a good entry-level introduction to pivot tables: Wikipedia: Pivot tables
Generally the pivot grid will contain the following elements:
- Pivot Rows - the unique values of the source columns which form the rows hierarchy.
- Pivot Columns - the unique values of the source columns which form the rows hierarchy
- Pivot Values - the aggregation funciton headers. They can be displayed below the columns or on the right side of the rows.
- Pivot Cells - each pivot cell contains the aggregated value for the respective row, column and aggregation function.
The pivot grid is entirely agnostic to the data source. You can use any data source to retrieve data using the jqxDataAdapter component
and then pass it to the
jqxPivot adapter which handles all aggregations. Finally, the pivot grid displays the aggregated data prepared by the jqxPivot adapter. Below is the step by step process:
Step 1 - Create a HTML file and include the required scripts/format
Step 2 - Create some sample data or use an existing data set
Step 3 - Create a data adapter to load the data from your data set
Step 4 - Create a pivot table data source with the desired pivot columns, pivot rows and pivot values
Step 5 - Inititialize the pivot grid and pass the pivot adapter as a source
Below is the pivot grid created with the sample data and settings
Pivot Grid Features
The jQuery PivotGrid Widget supports the following features:
- Binding to any tabular data source via the jqxDataAdapter
- Expandable rows and columns
- Pivot table filters
- Sorting rows and columns by the aggregated values in the pivot grid cells
- Visual pivot table designer
- Columns resize and rows resize
- OLAP and Compact/Tree style rows
- Automatic Sub-Totals and Grand-Totals
- Built-in data aggregation functions: count, sum, min, max, product, average
- Support for custom/user-defined aggregation functions
- Selection of pivot rows, columns and individual cells
- Multiple pivot rows, columns and cells selection
- Keyboard navigation
- Built-in themes
- Custom styles of rows, columns and cells using standard CSS
- Custom renderer functions for pivot rows, columns and cells