# Charts

> Build charts in DDL's chart builder from a project's nodes or your datasets: bar, line, area, pie, number, table and pivot, with filters, sorting and limits.

Source: https://dev.delman-guide.pages.dev/charts

A chart shows numbers from one node or Data Repository dataset. It belongs to a project and can appear on several [dashboards](/charts-dashboards), which follow its changes and the source's latest successful data.

> Screenshot: The Revenue by city chart builder with orders_enriched selected, Bar, Group by city and Sum of amount on the left, the revenue-per-city preview on the right, and Save as new and Save. Settings on the left, a live preview on the right.

:::note[Availability]
The chart builder is part of Dashboards, which is on by default. Saving needs **Modify Project**. With view access you can try settings, but cannot save them. [Dashboard viewer accounts](/dashboard-viewers) cannot open the builder.
:::

## Open the chart builder

You can start in four places:

| Where | What to click |
|---|---|
| Project menu | **Charts** › **New chart** |
| Node page | **Visualization**, with that node already chosen |
| Dashboard editor | **Add chart** › **New chart**, which opens a new tab |
| AI answer | **Save as chart**; see [Charts from AI answers](#charts-from-ai-answers) |

A new chart opens at `/projects/<id>/charts/new`. Open a saved chart by clicking its name on the project's **Charts** page.

## Build a chart

For *Revenue by city*, show the total amount for each city, highest first, using `orders_enriched`:

1. Under **Chart**, enter `Revenue by city` as the name. Add a **Description (optional)** if it helps explain the chart.
2. Under **Data**, choose `orders_enriched` in **Nodes of this project**.
3. Under **Chart type**, choose **Bar**.
4. Under **Group by**, choose `city`.
5. Under **Metrics**, choose **Sum** and `amount`.
6. Under **Sort and limit**, sort **Sum of amount** **Descending** and set **Show up to** to `10` **rows**.
7. Check the **Preview**, switching between **Chart** and **Data**, then click **Save**.

DDL confirms *Chart saved*. Names must be unique within the project. The demo data has eight cities, so a limit of ten shows all eight.

### Choose the data

**Data** offers two groups:

- **Nodes of this project**: successful transform and SQL results, dataset nodes, uploaded files and imported tables. A source-connection node or transfer node is not a table to chart; choose the node holding its data.
- **Datasets**: Data Repository datasets you own or that were shared with you, up to 500.

Changing the source resets groups, metrics, filters and sorting. If the source is being updated, wait for its columns. If it has no successful data or no columns, run it first or choose another source.

> Screenshot: A new chart's settings with the Data field showing Choose a source, followed by chart types, groups, metrics and filters. Start with Data: choose a node of the project or a dataset you can read.

### Chart types

| Type | What it shows | Groups and metrics |
|---|---|---|
| **Bar** | Compare values across categories | Up to two groups and one to five metrics |
| **Line**, **Area** | Follow values along a date or another ordered group | One or two groups and one to five metrics |
| **Pie** | Parts of a whole; smaller slices join **Other** | Exactly one group and one metric |
| **Number** | One large number, optionally compared with the previous period | No group, or one date group; choose the number under **Display** |
| **Table** | **Grouped numbers**, or **Rows of the source** | Grouped: up to two groups and five metrics. Rows: one to 30 columns |
| **Pivot** | Cross two categories | Exactly two groups and one metric |

### Group by and metrics

**Group by** splits the numbers by up to two columns. A date column also offers **Exact value**, **Day**, **Week**, **Month**, **Quarter** or **Year**. For daily revenue, group `order_date` by **Day**, rather than plotting every timestamp.

**Metrics** offers **Count**, **Distinct count**, **Sum**, **Average**, **Min** and **Max**. **Count** with **All rows** counts rows; counting a column counts its non-empty values. **Sum** and **Average** need number columns. You can add up to five metrics.

### Filters

Chart filters keep only rows matching every condition. Add up to ten, choosing a column, condition and value. These belong to the chart and apply wherever it appears; dashboard filters narrow the result further for each viewer.

Conditions follow the column type. Text, number and date options are listed in [Add filters](/charts-dashboards#add-filters); Boolean columns also offer **is**, **is not**, **is empty** and **is not empty**. **is one of** accepts up to 100 values.

### Sort and limit

Choose up to three sort fields, each **Ascending** or **Descending**. Without an explicit sort, a date group sorts by time ascending; otherwise grouped numbers sort by the first metric descending. Source rows have no default sort.

**Show up to** accepts 1 to 1,000 **rows**, with 100 as the default. A **First N rows** badge means the result was cut at that limit. Raise the limit or add filters if you need more of the data.

### Display

The available controls depend on the chart type:

| Type | Controls |
|---|---|
| **Bar** | **Stack the series**, **Horizontal bars**, **Legend** |
| **Line**, **Area** | **Legend**, and **Dots on the line** where offered |
| **Pie** | **Donut**, **Legend**, and **Slices before “Other”** (2 to 20, default 8) |
| **Number** | **Number to show**, **Short numbers (1.2M)** |

Switches may offer **Automatic**, **On** and **Off**. The palette follows light or dark appearance; there are no custom colour, axis-title or decimal settings.

### The preview

**Preview** redraws as you change settings. Use **Chart** to inspect the drawing and **Data** to check its rows. The footer gives the row count and **Data as of** time. A preview limit is not the total number of rows in the source.

For sensitive data, the preview warns that people who only see the chart through a shared dashboard get grouped numbers, never source rows. See [Personal and sensitive data](/dashboard-sharing#personal-and-sensitive-data).

## Change, copy or delete a chart

Open **Charts** in the project menu (`/projects/<id>/charts`). **Search charts** finds a name; the list shows **Name**, **Type**, **Used in**, **Owner** and **Updated**. Used in says how many dashboards show it, or **Not on dashboards**.

> Screenshot: The Demo Project Charts page with New chart, Search charts, Name, Type, Used in, Owner and Updated columns, five new charts and Top products marked Legacy; Revenue by city's menu has Edit, Duplicate and Delete. The project's charts and how many dashboards use each one.

- Click a chart to open it, or use ⋮ › **Edit** (**Open** for view-only access).
- **Save** updates the chart on every dashboard that uses it. Check those dashboards before changing groups or columns.
- **Save as new** saves a copy, using **(copy)** when the name is unchanged. Nothing on existing dashboards changes.
- ⋮ › **Duplicate** copies a chart from the list.

### Delete a chart

1. On the Charts page, open ⋮ › **Delete**.
2. Read **Delete chart** and confirm only if you intend to delete it.
3. If dashboards use it, DDL first lists them under **This chart is on dashboards**. **Remove from dashboards and delete** removes those tiles and the chart. **Cancel** keeps both.

Deletion needs edit access to the project and cannot be undone.

> Screenshot: This chart is on dashboards, listing Revenue by city on Sales overview, with Cancel and Remove from dashboards and delete. Before deleting a chart in use, DDL names the dashboards that lose its tiles.

## Charts made with the old editor

Old charts have a **Legacy** badge, meaning *Made with the old chart editor*. Opening one explains whether it can be converted.

- A simple chart offers **Convert to the new editor**. You can adjust it, but the old version is unchanged until you click **Save**. Saving replaces the chart in place on its dashboards.
- Charts using unsupported parts, such as SQL, joins or another project's data, remain read-only.
- Old charts keep working on signed-in dashboards. Public and embedded pages cannot show them; convert them first.
- A date without a time includes the whole day in the new editor. A converted chart may therefore count slightly different rows.

> Screenshot: Top products opened with the Legacy notice, Convert to the new editor and a read-only table preview. An old chart stays unchanged until you convert it and save.

## Charts from AI answers

[Optional]

Where AI answers are enabled and a model is connected, **Save as chart** on an Ask Data answer opens a draft:

1. Click **Save as chart** and choose the **Project**.
2. Click **Open chart builder**.
3. Read *Made from an AI answer — check the preview*, verify its source and numbers, then click **Save** if it is right.

Nothing is saved before you confirm in the builder. The draft opens once, in that browser, within an hour. See [AI Assistant](/ai-assistant#dashboards-and-charts).

## Limits

| Setting | Limit |
|---|---|
| Groups | 2 |
| Metrics | 1 to 5 |
| Columns in **Rows of the source** | 1 to 30 |
| Chart filters | 10 |
| Sort fields | 3 |
| **Show up to** | 1 to 1,000 rows; default 100 |
| Values in **is one of** | 100 |
| Series drawn | 12 |
| Pie slices before **Other** | 8 by default; adjustable from 2 to 20 |
| Pivot columns drawn | 50 |
| Chart query time | 10 seconds |
| Chart loads | 120 per minute per person |

## Troubleshooting

| Problem | Cause and fix |
|---|---|
| **New chart** is missing | You need **Modify Project** to create and save charts. |
| A node is missing from **Data** | Run it successfully first. Source-connection and transfer nodes cannot be charted; choose the node holding their data. |
| *Column “…” is not in the source* | A column was renamed or removed upstream. Choose an available column. |
| *The data of this chart is being updated* | Wait for the source to finish, then try again. |
| *The server is busy* | Other charts are running. Wait a few seconds. |
| **First N rows** | The result reached **Show up to**. Raise it or filter the data. |
| *Number can only be split by a date column* | Remove the group or choose a date column. |
| A converted chart shows different numbers | Check date filters: a date without a time covers its whole day. |

## Related pages

  - [Dashboards](/charts-dashboards): Arrange charts, text and filters on a page.
  - [SQL Query](/sql): Join and shape data before charting it.
  - [Data Repository](/data-repository): Use datasets directly as chart sources.
  - [AI Assistant](/ai-assistant): Turn an Ask Data answer into a chart draft.
