> For the complete documentation index, see [llms.txt](https://docs.toucanai.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toucanai.cloud/build/charts/chart-types/line-chart.md).

# Line chart

{% hint style="info" %}
**Target Audience**: Non-technical users and builders configuring charts in the Library.
{% endhint %}

<figure><img src="/files/AewJeGZ71j7XYrqREuvp" alt="Line chart example"><figcaption></figcaption></figure>

## Overview

A line chart shows how a **measure** evolves along a **dimension** on the horizontal axis.

* **Dimension (X-Axis):** one column — often a date, or categories such as region or product.
* **Measure (Line Y-Axis):** one column from your query, with an optional **Aggregation** (Sum, Count rows, etc.). Usually a numeric metric; counts (Count rows, Count distinct) work on any column type.

You can split the chart into several lines with **Categorize by line** (one line per category value). In the **Library**, enable **Manual Edit**, set **Type** to **Line**, and map columns from your query under **Data**.

Shared fields (**Title**, **Narrative**, **Data**) are documented in [Chart types](/build/charts/chart-types.md#shared-chart-level-settings).

## When to use it

**Good fit**

* Show a **trend over time** (revenue by month, headcount by year).
* Compare **a few series** on the same timeline (e.g. two or three regions).
* Track a KPI that changes across ordered categories (quarters, stages).

**Prefer another chart**

* Side-by-side category comparison or ranking → [Bar chart](/build/charts/chart-types/bar-chart.md).
* Part-to-whole → [Stacked bar chart](/build/charts/chart-types/stacked-bar-chart.md) or [Circular chart](/build/charts/chart-types/circular-chart.md).
* A single KPI number → [Value](/build/charts/chart-types/value.md).

**Examples:** revenue over time, headcount by department on a shared timeline, events counted per month.

{% hint style="warning" %}
With **Categorize by line**, keep few categories (about **three lines or fewer**) so the chart stays readable.
{% endhint %}

**Common setups**

* **Time series:** date on **X-Axis** + **Date granularity** + **Line Y-Axis** with aggregation.
* **Multi-line:** same as above + **Categorize by line** (e.g. region).
* **Counts over time:** date on **X-Axis** + **Count rows** or **Count distinct** on **Line Y-Axis**.

## Configuration options

Open the chart in the **Library**, turn on **Manual Edit**, select **Data** (database + query), then set **Type** to **Line**. Options match the editor panels **Dimension** and **Measure**; advanced fields are under *More dimension options* and *More measure options*.

Prerequisites: [connected database](/build/data-connections/how-to/add-a-database.md), Manual Edit enabled ([how-to](/build/charts/how-to/customize-a-chart-manually.md)).

### Dimension

| Option                 | How it works                                                                                          |
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
| **X-Axis**             | Horizontal axis (date, product, region, etc.).                                                        |
| **Date granularity**   | When **X-Axis** is a date: **Year**, **Quarter**, **Month**, **Week**, or **Day**.                    |
| **Date format**        | How date labels appear on the axis.                                                                   |
| **Order data**         | *More dimension options.* Sort by a column, ascending or descending.                                  |
| **Categorize by line** | *More dimension options.* One line per distinct value in the column.                                  |
| **Show all labels**    | *More dimension options.* Label under each X point; when off, labels may be thinned to avoid overlap. |

### Measure

| Option                       | How it works                                                                                                             |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Line Y-Axis**              | Column plotted on the vertical axis. Often numeric; use **Aggregation** (e.g. Count rows) for non-numeric columns.       |
| **Aggregation**              | Reduces rows before plotting.                                                                                            |
| **Format number**            | Shown when the measure is numeric (after aggregation). Style (Standard, Percent, Currency), decimals, optional **Unit**. |
| **Show value on line**       | *More measure options.* Values above each point.                                                                         |
| **Automatic y-axis scaling** | *More measure options.* On by default; off to set **Min** / **Max**.                                                     |
| **Exclude 0 values**         | *More measure options.* Removes rows where the measure is **0**, **null**, or empty (same as the UI label).              |

**Aggregations on Line Y-Axis**

| Aggregation                 | Typical column types |
| --------------------------- | -------------------- |
| Sum, Cumulated sum, Average | Integer, float       |
| Minimum, Maximum            | Integer, float, date |
| Count rows, Count distinct  | All types            |
| Standard deviation          | Integer, float       |

The AI assistant can pre-fill these fields when you create a chart with AI; use **Manual Edit** to adjust them.
