> 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/bar-chart.md).

# Bar chart

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

<figure><img src="/files/oj2YmVZsKFgT5TdgzlUN" alt="Bar chart example"><figcaption></figcaption></figure>

## Overview

A bar chart compares a **measure** across **categories**. Each bar’s length reflects **Bar height**; categories come from **Bar category** (vertical: horizontal axis; horizontal: category axis for rankings).

* **Dimension:** **Bar category** plus optional **Orientation** (vertical or horizontal).
* **Measure:** **Bar height** — one query column, with optional **Aggregation**.
* **Optional:** **Group bars** for side-by-side bars, or a **Line** overlay (vertical orientation only).

In the **Library**, enable **Manual Edit**, set **Type** to **Bars**, and map columns under **Data**.

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

## When to use it

**Good fit**

* Compare values across categories (sales by region, headcount by team).
* Show **rankings** with horizontal bars and optional **Show rank**.
* Combine bars with a second metric as a **line** (vertical only).

**Prefer another chart**

* Trend over time → [Line chart](/build/charts/chart-types/line-chart.md).
* Part-to-whole within each category → [Stacked bar chart](/build/charts/chart-types/stacked-bar-chart.md).
* Share of a total (few slices) → [Circular chart](/build/charts/chart-types/circular-chart.md).
* One big number → [Value](/build/charts/chart-types/value.md).

**Examples:** top products by revenue, department headcount, monthly sales with a target line.

**Common setups**

* **Vertical bars:** default orientation, **Bar category** + **Bar height**.
* **Ranking:** **Horizontal** + **Show rank** under *More dimension options*.
* **Grouped bars:** **Group bars** under *More dimension options*.
* **Bar + line:** vertical orientation, **Line Y-Axis** in the **Line** section.

## Configuration options

Open the chart in the **Library**, turn on **Manual Edit**, select **Data**, then set **Type** to **Bars**. Panels: **Dimension**, **Measure**, and **Line** (vertical only). Advanced fields: *More dimension options* / *More measure options*.

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

### Dimension

| Option               | How it works                                                                                                    |
| -------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Orientation**      | **Vertical** (default) or **Horizontal**. Horizontal hides the **Line** section.                                |
| **Bar category**     | Category axis (X when vertical, Y when horizontal).                                                             |
| **Date granularity** | When **Bar category** is a date: **Year**, **Quarter**, **Month**, **Week**, or **Day**.                        |
| **Date format**      | How date labels appear on the category axis.                                                                    |
| **Order bars**       | *More dimension options.* Sort by a column, ascending or descending.                                            |
| **Group bars**       | *More dimension options.* Side-by-side bars per category value.                                                 |
| **Show all labels**  | Only shown when **Orientation** is **Vertical**. *More dimension options.* Label under each bar.                |
| **Show rank**        | Only shown when **Orientation** is **Horizontal**. *More dimension options.* Rank numbers on the category axis. |

### Measure

| Option                       | How it works                                                                                            |
| ---------------------------- | ------------------------------------------------------------------------------------------------------- |
| **Bar height**               | Column for bar length. Often numeric; use **Aggregation** (e.g. Count rows) otherwise.                  |
| **Aggregation**              | Reduces rows before plotting (see below).                                                               |
| **Format number**            | Shown when the measure is numeric (after aggregation). Standard, Percent, Currency, decimals, **Unit**. |
| **Show value on bar**        | *More measure options.* Values on bars (on by default).                                                 |
| **Automatic y-axis scaling** | *More measure options.* On by default; off for **Min** / **Max**.                                       |
| **Exclude 0 values**         | *More measure options.* Removes rows where the measure is **0**, **null**, or empty.                    |

### Line (vertical orientation only)

| Option                              | How it works                                                  |
| ----------------------------------- | ------------------------------------------------------------- |
| **Line Y-Axis**                     | Second metric as a line. Clear the column to remove the line. |
| **Aggregation**                     | Shown after **Line Y-Axis** is selected.                      |
| **Show value on line**              | Values on line points.                                        |
| **Unify scales for bars and lines** | On by default: bars and line share one scale.                 |

**Aggregations on Bar height and 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; use **Manual Edit** to adjust.

**Suggested next steps:** [Chart types](/build/charts/chart-types.md) · [Line chart](/build/charts/chart-types/line-chart.md) · [Customize a chart manually](/build/charts/how-to/customize-a-chart-manually.md) · [Create a chart with AI](/build/charts/how-to/create-a-chart-with-ai.md)
