---
title: "Custom visualizations"
description: "Add your own chart types to Metabase by uploading custom visualizations built with the Custom Visualizations SDK."
url: "https://www.metabase.com/docs/latest/questions/visualizations/custom"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Custom visualizations

> Custom visualizations is only available on [Pro](https://www.metabase.com/product/pro) and [Enterprise](https://www.metabase.com/product/enterprise) plans (both self-hosted and on Metabase Cloud).

You can build new chart types and add them to Metabase. Here's a calendar heatmap:

![Calendar heatmap custom visualization](https://www.metabase.com/docs/latest/questions/images/custom-viz-calendar-heatmap.png)

Here's the [code for that calendar heatmap viz](https://github.com/metabase/custom-viz-calendar-heatmap).

This page covers how to add a custom visualization to your Metabase. To _create_ a new custom visualization, see [developing a custom visualization](https://www.metabase.com/docs/latest/developers-guide/custom-visualizations.md).

## Enabling custom visualizations

### Restrict image domains first

Before you can turn on custom visualizations, you need to enable [Restrict image domains](https://www.metabase.com/docs/latest/configuring-metabase/domains.md#restrict-where-images-can-load-from). A custom visualization runs third-party JavaScript in your Metabase. By restricting image (and font) domains, you limit where that code can load assets from, which narrows the ways a custom visualization could leak data through outbound asset requests. See [Only add visualizations you trust](#only-add-visualizations-you-trust).

While custom visualizations are enabled, you can't turn **Restrict image domains** back off. You'll need to first disable custom visualizations.

### Turn on custom visualizations

To turn on custom visualizations, go to **Admin** > **Settings** > **Custom visualizations** and click **Enable custom visualizations**.

On self-hosted Metabases, you can also enable (or disable) custom visualizations with the [`MB_CUSTOM_VIZ_ENABLED`](https://www.metabase.com/docs/latest/configuring-metabase/environment-variables.md#mb_custom_viz_enabled) environment variable.

## Adding a custom visualization

Once you've [built the custom visualization](https://www.metabase.com/docs/latest/developers-guide/custom-visualizations.md):

1. In Metabase, go to **Admin** > **Settings** > **Custom visualizations** > **Manage visualizations**.
2. Click **Add** and drag the `.tgz` file into the upload area (or click to browse for it).
3. Click **Add visualization**.

- Bundles must be smaller than 5 MiB.
- Each custom visualization lists the Metabase versions it supports (for example, "Requires Metabase >=1.62 <1.64"). If your Metabase isn't in that range, the visualization still uploads and works, but Metabase adds a [compatibility warning](#compatibility-warnings-are-heads-ups-not-errors).
- The **Manage visualizations** page shows each custom visualization's icon, name, the first eight characters of the bundle's hash, and its required Metabase version range, so you can tell which version is installed.

## Using a custom visualization

On a question, dashboard or document card, open the visualization sidebar (the **Visualization** button), and look for the **Custom visualizations** section. Pick your visualization the same way you'd pick a line chart or a table, and voilà, there's that gondola line chart you needed:

![Gondola line chart](https://www.metabase.com/docs/latest/questions/images/gondola-line-chart.png)

If a custom visualization can't render the current query results (for example, if the query is missing a column the visualization needs), Metabase shows the error message from the custom visualization so you can adjust the query or pick a different chart.

Custom visualizations behave like built-in charts in most places:

- **Settings.** Click the **gear** icon in the visualization sidebar to change the visualization's settings. A custom visualization defines its own setting tabs: each setting names the section it belongs to.
- **Dark mode.** Custom visualizations that use Metabase's colors adapt to [dark mode](https://www.metabase.com/docs/latest/people-and-groups/account-settings.md#theme) automatically.
- **Icons.** A custom visualization shows its own icon in the visualization picker, and questions that use it show that icon in collections and bookmarks.

### Custom visualizations in embeds only work when people are signed in

[Modular embeds](https://www.metabase.com/docs/latest/embedding/modular-embedding.md) that use SSO can render custom visualizations, whether you embed with web components or with the [React SDK](https://www.metabase.com/docs/latest/embedding/sdk/introduction.md). You allowlist the custom visualizations you want to load with the `allowedCustomVisualizations` setting. See [Custom visualizations in embeds](https://www.metabase.com/docs/latest/embedding/custom-visualizations.md).

Embeds without an authenticated person don't render custom visualizations. In [guest and static embeds](https://www.metabase.com/docs/latest/embedding/introduction.md) and [public links](https://www.metabase.com/docs/latest/embedding/public-links.md), any card that uses a custom visualization falls back to the default visualization for the query's results.

## Managing custom visualizations

_Admin > Settings > Custom visualizations > Manage visualizations_

- **Disable a visualization.** Any question, dashboard card, or document card that used the visualization falls back to the default visualization for that query's results. If you re-enable the visualization, those cards will go back to using the custom visualization.
- **Replace a bundle.** Upload a new `.tgz` to ship an updated version of a custom visualization. The new bundle's manifest `name` _must_ match the existing visualization's identifier, so questions that already use the visualization keep working.
- **Remove a visualization.** Cards that used the custom viz fall back to the default visualization.

### Compatibility warnings are heads-ups, not errors

Metabase flags a custom visualization on the **Manage visualizations** page when:

- **The SDK version doesn't match.** The visualization was built with a version of the Custom Visualizations SDK that your Metabase wasn't tested against.
- **The Metabase version doesn't match.** A visualization that was in range when you uploaded it can fall out of range when you upgrade Metabase, so this warning can show up on a visualization that's been working for months.

## Exports

- **Dashboard subscriptions and alerts don't use custom visualizations**. Cards that use custom visualizations will fall back to a default visualization for the card's data shape.
- **PDF exports of dashboards include custom visualizations**.
- **Custom visualizations can support PNG export**, but only if their developer turned on PNG export for that visualization. PNG export is off by default.

## Only add visualizations you trust

A custom visualization runs JavaScript in your Metabase. Only upload custom visualizations from sources you trust (like ones you've built yourself, or have vetted).

Metabase runs custom visualizations in a sandbox to limit what a custom visualization can do:

- A custom visualization renders inside an isolated container and can't reach the rest of the Metabase app.
- A custom visualization can't call Metabase's APIs or make network requests.

While this sandboxing limits the damage a custom visualization can do, you still need to review the code.

## Further reading

- [Building custom visualizations](https://www.metabase.com/docs/latest/developers-guide/custom-visualizations.md)
- [Visualization overview](https://www.metabase.com/docs/latest/questions/visualizations/visualizing-results.md)
- [Appearance](https://www.metabase.com/docs/latest/configuring-metabase/appearance.md)
