# Pivot charts

<figure><img src="https://4179539225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZqboFGZzD87nn7oPsm%2Fuploads%2F8dSvnV07uF8EM7wVkdpC%2FScreenshot%202025-03-26%20at%2016.26.34.png?alt=media&#x26;token=5f6f3feb-4c8e-4b8c-9608-b94845f320e6" alt=""><figcaption><p>Pivot chart comparing multiple aggregated series</p></figcaption></figure>

In the default charting mode, you can easily create a simple chart with selected columns on both axes.  However, creating a chart that compares multiple series (like the screenshot above) requires enabling the **pivot mode** by using the toggle at the top of the chart.

<figure><img src="https://4179539225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZqboFGZzD87nn7oPsm%2Fuploads%2FE5lVJbkTK12FMZdbXQet%2FScreenshot%202025-03-26%20at%2016.00.30.png?alt=media&#x26;token=b265a474-40d7-4345-a036-6fc5801b8aa6" alt=""><figcaption><p>Toggle pivot mode</p></figcaption></figure>

Once enabled, you will see that the *Set Up* tab has changed. Instead of choosing a category and series, you can now additionally choose *Color by* and *Group by* fields.

For this guide, we will try to recreate the chart in the top screenshot and assume a dataset about car sales with the following structure:

| brand  | year | nb\_sales |
| ------ | ---- | --------- |
| Ford   | 2025 | 5791      |
| Ford   | 2024 | 3381      |
| Toyota | 2025 | 4002      |
| Toyota | 2024 | 5821      |
| ...    | ...  | ...       |

**Note**: the number of sales are imaginary numbers.

#### 1. Color by

The "*Color by*" field decides which column your data will be pivoted on. In other words, the data will be split into the values of the column you choose here, and each value will be represented with a unique color. In our example, let's pick the **brands** column because we want to see the number of sales per brand.

**Note**: this is the equivalent of the "*Color"* field in the legacy chart configuration.

<figure><img src="https://4179539225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZqboFGZzD87nn7oPsm%2Fuploads%2FPgfNoT8NLNn5wPZeZcNJ%2FScreenshot%202025-03-26%20at%2016.28.14.png?alt=media&#x26;token=7bebd3ad-f22d-4f65-a962-1ddd341fda0f" alt=""><figcaption></figcaption></figure>

#### 2. Series

Similarly to the normal charting mode, series are the numerical values you want to chart. When adding a series, you'll first have to select the column. Additionally, since the data is being pivoted, you must also choose an aggregate. By default this will be set to average.

<figure><img src="https://4179539225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZqboFGZzD87nn7oPsm%2Fuploads%2FlVr9B4g6vaLvaZOKCHHA%2FScreenshot%202025-03-26%20at%2016.31.36.png?alt=media&#x26;token=7ec461de-25b4-473e-a1f2-c99897ff4a54" alt=""><figcaption></figcaption></figure>

#### 3. Group by

Finally, you can optionally choose to group your data by a specific column. It's a way to split your data into different segments on top of the "*Color by*" field. In this example we can choose to group the data by year so that we can see the trends.

<figure><img src="https://4179539225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZqboFGZzD87nn7oPsm%2Fuploads%2FRMfX73VLeZnC73n8c3A9%2FScreenshot%202025-03-26%20at%2016.42.18.png?alt=media&#x26;token=8d048ac0-4936-4e59-af77-aa8ff1a28e7c" alt=""><figcaption></figcaption></figure>

Finally, in the *Chart* tab, don't forget to change the chart type from a bar chart to a line chart.
