# Getting Started with the Kendo UI for Vue PivotGrid

This guide provides essential information about using the Kendo UI for Vue PivotGrid. You will learn how to install the package, add a PivotGrid component to your project, style the component, and activate your license.

<CtaPanelOverview></CtaPanelOverview>

After completing this guide, you will be able to reproduce the following example.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/pivotgrid/get-started/source.txt)

## Setting Up Your Vue Project

Before you install the Kendo UI for Vue PivotGrid, make sure that you have a running Vue project. The easiest way to set up a Vue project is to use the approach described in the [Set up the Vue project](https://www.telerik.com/kendo-vue-ui/components/getting-started/javascript-composition-api#1-set-up-the-vue-project) section of the [First Steps with JavaScript](https://www.telerik.com/kendo-vue-ui/components/getting-started/javascript-composition-api) article.

## Install the Component

To install the PivotGrid package, run the following command in the root folder of your Vue project:

```sh
npm i @progress/kendo-vue-pivotgrid
```

## Importing the Component

After installing the package, import the PivotGrid component in the Vue App.

In the `src/App.vue` file of your Vue project, import the `PivotGrid`, `PivotGridContainer` and `usePivotOLAPService` from the PivotGrid package. The `usePivotOLAPService` composable binds the PivotGrid to an OLAP cube.

```js
// ES2015 module syntax
import { PivotGrid, PivotGridContainer, usePivotOLAPService } from '@progress/kendo-vue-pivotgrid';
```

```js
// CommonJS format
const { PivotGrid, PivotGridContainer, usePivotOLAPService } = require('@progress/kendo-vue-pivotgrid');
```

## Using the Component

1. Define the `defaultColumnAxes`, `defaultRowAxes` and the `defaultMeasureAxes`. Each item is a `PivotGridAxis` object that describes a single column, row, or measure axis.

   ```js
   const defaultColumnAxes = [
       { name: ['[Date].[Calendar]'], expand: true },
       { name: ['[Product].[Category]'] }
   ];
   const defaultRowAxes = [{ name: ['[Geography].[City]'] }];
   const defaultMeasureAxes = [{ name: ['[Measures].[Reseller Freight Cost]'] }];
   ```

2. Define the `catalog`, `cube`, and `url`.

   ```js
   const catalog = 'Adventure Works DW 2008R2';
   const cube = 'Adventure Works';
   const url = 'https://demos.telerik.com/service/v2/olap/msmdpump.dll';
   ```

3. Pass the configuration to the `usePivotOLAPService` composable in the `<script setup>` block of the `src/App.vue` file.

   ```js
   const { pivotProps } = usePivotOLAPService({
       catalog,
       cube,
       url,
       defaultRowAxes,
       defaultColumnAxes,
       defaultMeasureAxes
   });
   ```

4. Add the component's markup to the template section of the `src/App.vue` file in your project and set the desired properties.

   ```html
   <template>
       <PivotGridContainer>
           <PivotGrid v-bind="pivotProps" :style="{ height: '700px' }" :column="WideColumn" />
       </PivotGridContainer>
   </template>
   ```

5. To style the PivotGrid, install and import the [Meridian theme](https://www.telerik.com/design-system/docs/themes/kendo-themes/meridian/), which is one of the [five beautiful themes](https://www.telerik.com/kendo-vue-ui/components/styling) for Kendo UI for Vue.

   1. Install the Meridian theme package.

      ```sh
      npm i @progress/kendo-theme-meridian
      ```

   2. Import the Theme package in `src/App.vue`.

      ```js
      import '@progress/kendo-theme-meridian/dist/all.css';
      ```

6. Build and run the application by typing the following command in the root folder of your project:

   ```sh
   npm run dev
   ```

7. Navigate to the URL displayed in the terminal to see the Kendo UI for Vue PivotGrid component on the page.

## Activating Your License Key

Using any of the UI components in the Kendo UI for Vue library requires either a commercial license key or an active trial license key.

Follow the instructions on the [My License page](https://www.telerik.com/kendo-vue-ui/components/my-license) to activate your trial or commercial license. You can skip this step if your application already contains a Kendo UI for Vue license file.

## Dependencies

The PivotGrid package requires you to install the following [peer dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/) in your application:

| Package Name                     | Description                                                                                                                                                                       |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| vue 3.0.0+                       | Contains the functionality necessary to define Vue components.                                                                                                                    |
| @progress/kendo-licensing        | Contains the internal infrastructure related to licensing.                                                                                                                        |
| @progress/kendo-data-query       | Contains the data query helpers.                                                                                                                                                  |
| @progress/kendo-pivotgrid-common | Contains the framework-agnostic PivotGrid data processing and OLAP communication logic.                                                                                           |
| @progress/kendo-svg-icons        | Contains the SVG icons for the components.                                                                                                                                        |
| @progress/kendo-vue-common       | Contains the common utilities of the Kendo UI for Vue suite.                                                                                                                      |
| @progress/kendo-vue-intl         | Contains the Kendo UI for Vue Internationalization package that applies the desired cultures by providing services and pipes for the parsing and formatting of dates and numbers. |
| @progress/kendo-vue-animation    | Contains the Kendo UI for Vue Animation components.                                                                                                                               |
| @progress/kendo-vue-buttons      | Contains the Kendo UI for Vue Buttons components.                                                                                                                                 |
| @progress/kendo-vue-dropdowns    | Contains the Kendo UI for Vue DropDowns components.                                                                                                                               |
| @progress/kendo-vue-form         | Contains the Kendo UI for Vue Form components.                                                                                                                                    |
| @progress/kendo-vue-indicators   | Contains the Kendo UI for Vue Indicators components.                                                                                                                              |
| @progress/kendo-vue-inputs       | Contains the Kendo UI for Vue Inputs components.                                                                                                                                  |
| @progress/kendo-vue-labels       | Contains the Kendo UI for Vue Labels components.                                                                                                                                  |
| @progress/kendo-vue-popup        | Contains the Kendo UI for Vue Popup component.                                                                                                                                    |
| @progress/kendo-vue-treeview     | Contains the Kendo UI for Vue TreeView component.                                                                                                                                 |

## Suggested Links

* [API Reference of the PivotGrid](https://www.telerik.com/kendo-vue-ui/components/pivotgrid/api)
* [Configurator](https://www.telerik.com/kendo-vue-ui/components/pivotgrid/configurator)
* [Filtering](https://www.telerik.com/kendo-vue-ui/components/pivotgrid/filtering)
* [Sorting](https://www.telerik.com/kendo-vue-ui/components/pivotgrid/sorting)
* [FAQ](https://www.telerik.com/kendo-vue-ui/components/pivotgrid/faq)

## Learning Resources

* [Getting Started with Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/components/getting-started)
* [Virtual Classroom (Training Courses for Registered Users)](https://learn.telerik.com/learn/course/internal/view/elearning/45/kendo-ui-for-vue-with-typescript)
* [Explore the Coffee Warehouse Sample Application](https://github.com/telerik/kendo-vue/tree/master/examples-standalone/coffee-warehouse)
* [Explore the GitHub Dashboard Sample Application](https://github.com/telerik/kendo-vue/tree/master/examples-standalone/dashboard)
