> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create reusable chart types with Chart Studio

> Reusable chart types you build once for your project, then use like any built-in chart type

> [!NOTE]
>
> Chart Studio is available on Lightdash Cloud. Self-hosted instances need an Enterprise license and the [app runtime](https://docs.lightdash.com/self-host/enterprise-features/data-apps.md#chart-studio) configured. It doesn't need [data apps](https://docs.lightdash.com/data-apps) turned on. See [Permissions](#permissions) for who can build chart types.

Chart Studio is the agentic in-platform interface for building [custom chart types](https://docs.lightdash.com/visualizations/custom-charts). You describe the chart you want, Lightdash builds it, and anyone in the project can then use it like a built-in chart type. Open **Configure** in the Explorer, click **Change**, and pick it from the **Custom** group of the chart type gallery.

The same chart type can power many saved charts, each with its own query and field mapping.

[Chart Studio demo](https://www.youtube.com/embed/LYei_5W2Tv8)

## Browsing chart types

Every chart type in the project lives in Chart Studio. Go to **Browse** and pick **Chart Studio**.

Each card previews the chart type with sample data. Click a card to see its description, who built it, its inputs, and its current version, and to preview it in the Explorer, edit it, or delete it.

![Chart Studio, showing cards for each of the project's chart types](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-gallery-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=17445893cf5118462aa09eea4bc35d64)

## Building a chart type

Build chart types from the Explorer, on top of a query whose results look like the ones the chart type will render against. Working against real data as you prompt makes the preview trustworthy and cuts out the sample-to-real gap you'd otherwise close after the fact.

**1. Run the query you want to design against**

In the Explorer, pick the dimensions and metrics the chart type needs and run the query. The results become Chart Studio's preview data.

**2. Open Chart Studio**

Open **Configure**, click **Change**, and pick the **New chart type** tile in the **Custom** group. Chart Studio opens in the chart panel and the sidebar switches to its generated options.

**3. Describe the chart**

Type what you want in the prompt bar. Chart Studio builds it and renders it against your query's real results. The **Generated options** panel holds the display options the chart type declares, along with a color palette to preview it against. Follow-up prompts create new versions, and **History** opens a panel where you can view an earlier version or restore it.

**4. Name it**

Name and describe the chart type in the header. That's what people see in the gallery and in the chart type picker.

![Chart Studio, with the generated options panel, the sample-data preview, the version history, and the prompt bar](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-builder-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=b9259db9c56dca02e853d997c6af4274)

To edit a chart type you already have selected in the Explorer, click the pencil next to its name in the **Configure chart** sidebar.

You can also start from **Browse → Chart Studio**: click **New chart type** to open Chart Studio against sample data, then click **Preview in explorer** when you want to try it against a real query.

> [!TIP]
>
> Chart types can also be developed on your machine and uploaded with the CLI. See [Chart types as code](#chart-types-as-code). AI assistants connected to the [Lightdash MCP server](https://docs.lightdash.com/agents/lightdash-mcp.md#chart-types) can build them too.

## Using a chart type in a chart

**1. Run your query**

Select the dimensions and metrics your chart needs and run the query. You have to run it before you can pick a custom chart type.

**2. Pick the chart type**

Open **Configure** to open the chart sidebar, then click **Change**. The **Custom** group at the top of the gallery lists the project's chart types; click the **more** tile to see the rest, or search the gallery by name. Only chart types that finished building are listed.

**3. Map your fields**

Each of the chart type's inputs gets a field picker in the **General** tab, the same as configuring axes on a bar or line chart. Required inputs can't be cleared. The chart type's own display options sit in the tabs beside it.

The chart re-renders as you change the mapping or the underlying query.

![A custom chart type selected in the Explorer sidebar, with its inputs mapped to the query's fields and the chart rendering](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-mapping-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=7022a879d2dfb8962af764786216400f)

## Saving and dashboards

Save the chart like any other chart. The saved chart remembers which chart type it uses, how its inputs are mapped, and which version of the chart type it uses (see [Versions and upgrades](#versions-and-upgrades)).

Saved charts render in chart view and as dashboard tiles, driven by each surface's own query - dashboard filters and [date zoom](https://docs.lightdash.com/explore/dashboards/date-zoom.md) apply like any other chart tile. Charts in [documents](https://docs.lightdash.com/explore/documents.md) can use the chart type too.

A saved chart built on a chart type exports as a PNG only. See [download results or a chart image](https://docs.lightdash.com/explore/share-charts.md#download-results-or-a-chart-image) for when the export option appears.

## Versions and upgrades

Every follow-up prompt in Chart Studio creates a new version of the chart type. A saved chart keeps using the version it was saved with, so changing a chart type never changes the charts that already use it.

When you edit a chart and a newer version of its chart type exists, the **Configure chart** sidebar shows **Newer version available**. Click **Review upgrade** to see what changed: inputs and options that were added, renamed or removed, and any change to the color palette.

![The Upgrade chart type dialog over the Explorer, listing what changed since the chart's version](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-upgrade-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=1570372d3a3923583b00a00fdafb0c24)

Click **Upgrade** to move the chart to the latest version. Only that chart moves, and nothing changes until you save it. If the new version added a required input, map a field to it and the chart renders again.

Chart Studio has its own upgrade, for the chart type itself. When a chart type was built on an older version of the data apps runtime, the Chart Studio header shows **Upgrade available**. Starting it rebuilds the chart type as a new version, and **History** shows what's new. How the chart type renders doesn't change unless you ask for it in a follow-up prompt.

Chart types on the current runtime reflow for narrow and short tiles, such as a dashboard stacked into one column on a phone. An older chart type doesn't reflow until you upgrade it and ask for it to adapt to small tiles in a follow-up prompt.

## Chart types as code

Chart types round-trip through the CLI as their own resource, separate from data apps. Each one downloads to `lightdash/chart-types/<slug>/` as a locally buildable project you can version in git, edit, validate with [`lightdash apps validate`](https://docs.lightdash.com/workflow/cli/reference#lightdash-apps-validate), and upload back:

```bash theme={null}
lightdash download --chart-types-only --chart-types calendar-heatmap
lightdash upload --chart-types calendar-heatmap
```

A chart type's identity is the `slug` in its `lightdash-app.yml` manifest, upserted in the target project on upload. The manifest also carries a `vizSchema` field with the chart type's declared inputs, so the inputs round-trip with the source.

Saved charts reference their chart type by that slug in chart YAML (the `dataAppVizSlug` field), which keeps chart files portable across projects and instances:

* Downloading charts brings the chart types they render with along automatically, into `lightdash/chart-types/`.
* Uploading a chart resolves the slug in the target project. If the chart type doesn't exist there, the chart upload fails with a message to run `lightdash upload --chart-types <slug>` first.
* A dashboard uploaded while one of its charts is missing from the target project still uploads, with a warning that the chart was not found. That tile is saved without a chart and shows **This chart has been deleted**, and uploading the chart afterwards doesn't repair it. Upload the chart type and the chart, then re-upload the dashboard with `lightdash upload --force`, which uploads files that haven't changed.
* Chart YAML written before slug references carries a `dataAppVizUuid` instead. Uploads accept it, but new downloads always write the slug.

The folder layout and server-side build pipeline are the same as for data apps — see [Local data app development](https://docs.lightdash.com/workflow/local-data-app-development.md), and the `--chart-types` flags on [`lightdash download`](https://docs.lightdash.com/workflow/cli/reference#lightdash-download) and [`lightdash upload`](https://docs.lightdash.com/workflow/cli/reference#lightdash-upload) for the full flag lists.

## Permissions

Chart types are available across the whole project. They don't live in spaces and can't be moved into one.

* Anyone who can view a chart can see the chart type it renders with.
* Editors and above can build new chart types.
* You can edit and delete the chart types you built. Project admins can edit and delete any of them.

> [accordion] Linking external connections
>
> Chart types render in the same sandbox as data apps, so they can only reach the network through [external connections](https://docs.lightdash.com/data-apps/external-connections.md). That covers two cases: calling a third-party API while the chart renders, and showing images from a URL field in your results. Without a linked connection, the sandbox blocks images from any other origin.
>
> Links don't need a connection. A link the viewer clicks can open in a new tab or move the current tab to its address, but the chart type's code can't redirect the page without a click.
>
> A project admin registers the connection once, then whoever builds the chart type links it from Chart Studio.
>
> **1. Register the connection**
>
> Go to **Project Settings → Data app connections** and click **Add connection**. Enter the **Base URL** of the host the chart type needs to reach and pick the auth method that host requires. A public image host needs **None**.
>
> **2. Allow images from it**
>
> If the chart type shows images, turn on **Allow public images in linked apps**. Linked chart types can then load images straight from that origin, in `<img>` tags or CSS. Leave it off for hosts you only call for data.
>
> **3. Choose who can link it**
>
> Set **Who can link this connection?** to **Data app and chart type builders** so editors can attach it from Chart Studio. **Admins only** keeps it out of everyone else's picker.
>
> **4. Attach it in Chart Studio**
>
> Open the chart type in Chart Studio, or start a new one, and click **Add external connections** in the prompt bar. Tick the connection, then describe the chart, or send a follow-up prompt such as "show the image from the Image URL input". The link is created when that build runs, so an existing chart type needs at least one follow-up prompt to pick it up.
>
> ![Chart Studio open in the Explorer, with the Add external connections picker showing a linked image host and the chart rendering an icon per bar](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-connections-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=7c341b44e8746f298490297f2b277b92)
>
> **5. Check it in the Explorer**
>
> Click **Preview in explorer**, run a query that includes the image URL field, and map it to the chart type's input. The images should render.
>
> ![The Explorer showing the chart type with its inputs mapped to the query's fields and an icon rendering next to each category](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/chart-studio/custom-chart-types-connections-explorer-light.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=1b871b4517fe3377b3c4d307dd1ae896)
>
> Once linked, the connection stays with the chart type across versions and everywhere it renders: the Chart Studio preview, the Explorer, saved charts, dashboard tiles, and embedded dashboards. The indicator in the prompt bar counts linked connections. Open it and untick a connection to unlink it. Unlinking only removes the link, so the generated code keeps calling the connection until you build a new version.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.