# Angular PivotGrid (jqxPivotGrid)

Source: https://www.jqwidgets.com/angular/angular-pivotgrid/index.htm

> jqxPivotGrid for Angular: Pivot table for summarising data by rows, columns and aggregate functions, with a drag-and-drop designer.

jqxPivotGrid is the jQWidgets PivotGrid component for Angular.

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 function 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.

## 12 demos, each with its source code

- [Pivot Grid Cell Values Alignment](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-cell_values_alignment.htm): Description This example demonstrates how to change the alignment of the values displayed in grid cells of the Angular pivot component. The default behavior is to align the values to the right side of the grid cells. To change the default cells alignment, use the formatSettings align property during the definition of the value fields of the Angular pivot grid. In addition to cells content alignment, the formatSettings object allows you to specify how to format the numbers displayed in the pivot grid cells. For example, you may change the number of digits after the decimal point, the thousands separator, whether negative numbers will be displayed in brackets or with a minus sign, as well as custom prefix and sufix text.
- [Pivot Grid Custom Pivot Function](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-custom_pivot_function.htm): Description This is an example of the Angular Pivot Grid with custom a custom data aggregation function. The pivot grid component provides several built-in functions: count, sum, min, max, average, product. In this example, we implement a custom function that calculates the variance of the data points of the respective pivot grid cell. To add or modify existing data aggregations, set the customAggregationFunctions property of the pivot data source. Each pivot aggregation functions must have a unique name, take an array of values as a parameter and return a number. For performance reasons, make sure that the function runs as quickly as possible. The Angular pivot grid will call the function multiple times during the data pivoting operations.
- [Pivot Grid Custom Rendering](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-custom_rendering.htm): Description This is an example of Angular Pivot Grid with custom style of the grid cells depending on their current value. You can change the rendering of any cell, row or column and insert your own HTML content by implementing the itemsRenderer and cellsRenderer functions. In this case, the custom code simply chooses among five predefined colors and sets the backgroundColor property of the cell content. This color customization is applied only to the cells with 'Sum' aggregation function. You can change the code of the itemsRender and cellsRenderer functions and implement your own customization logic using standard HTML and CSS.
- [Pivot Grid Designer](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-designer.htm): Description This is an example of the Angular Pivot Grid Component and the Pivot Grid Designer Component. You can use the pivot grid designer to select which fields will be displayed on rows and columns. You can also select different value fields and choose an aggregation function. Simply drag and drop fields in the respective area and the pivot grid's content will update automatically. You can also click on the menu of each columns, rows, filters or values item and select additional options like text alignment, number formatting and numbers alignment.
- [Pivot Grid Drill Through Cell](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-drill_through.htm): Description This is an example of the drill through functionality of the Angular Pivot Grid . This feature allows you to find the records in the data source which were used to calculate the value of a particular cell in the pivot grid. To drill through a specific grid cell double click on it and you will see a window displaying the source records. In addition to the pivot grid component, this example uses the window and datatable components. The example also demonstrates how to handle open and close events of the window component in Angular and how to enable or disable the selection functionality of the pivot grid component.
- [Pivot Grid Events](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-events.htm): Description This example demonstrates the events handling functionality of the Angular Pivot Grid Component. The pivot grid raises events when you change sorting, click on pivot rows, pivot columns and grid cells, expand or collapse rows and columns, and change the current selection. Some of the events support cancelation which allows the developer to intercept the event while it is in progress and cancel it based on custom logic.
- [Pivot Grid Localization](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-localization.htm): Description This is an example of the language localization feature of Angular Pivot Grid. The pivot grid uses multiple properties to display various messages and texts. All of them are customizable and you can adapt them to any language by defining your custom localization object.
- [Pivot Grid OLAP and Tree Style Rows](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-olap_tree_style_rows.htm): Description This is an example of the Angular Pivot Grid with rows rendered in a tree structure where the parent row appears above the descending rows. The Angular pivot grid also supports a rendering mode where the parent rows appear on the left side relative to their descending rows. Click the button below the pivot grid to switch the pivot rows display style between OLAP and compact tree-style display.
- [Pivot Grid Row, Columns and Cells Styling with CSS](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-rows_columns_cells_css_styling.htm): Description This is an example of the Angular Pivot Grid Component with custom style of the grid cells depending on their selection state. You can override the style of any pivot grid cell, row or column using standard CSS. The custom styles can be applied during the data binding definitions and you can use different styles for different pivot dataFields. The Angular pivot grid also allows you to override the style of individual rows and columns at runtime after the databinding step.
- [Pivot Grid Totals](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-totals.htm): Description This is an example of the Angular Pivot Grid Component with SubTotals and GrandTotals displayed on the pivot rows and columns. The pivot grid component can be configured to display SubTotals and GrandTotals at the same time or separately. It is also possible to configure different totals settings for the pivot rows and the pivot columns. To change the default settings modify the totals property of the pivot data adapter.
- [Pivot Grid with Values on Columns](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-values_on_columns.htm): Description This is an example of the Angular Pivot Grid Component with the pivot values displayed along the pivot columns. The Angular PivotGrid can displays the pivot values fields either below each column or on the right side of each pivot row. The default behavior is to display the pivot values along the columns. To change it this option modify the pivotValuesOnRows property in the pivot data source.
- [Pivot Grid with Values on Rows](https://www.jqwidgets.com/angular/angular-pivotgrid/angular-pivotgrid-values_on_rows.htm): Description This is an example of the Angular Pivot Grid Component with the pivot values displayed along the pivot rows. The Angular PivotGrid can displays the pivot values fields either below each column or on the right side of each pivot row. The default behavior is to display the pivot values along the columns. To change it this option modify the pivotValuesOnRows property in the pivot data source.

## Documentation

- [Getting started](https://www.jqwidgets.com/angular-components-documentation/documentation/jqxpivotgrid/angular-pivotgrid-getting-started.htm)
- [API reference](https://www.jqwidgets.com/angular-components-documentation/documentation/jqxpivotgrid/angular-pivotgrid-api.htm)
- [JavaScript version](https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxpivotgrid/index.htm)
