Embedding requires the embedding add-on for Cloud Pro or Enterprise. Get in touch to add embedding to your plan. For self-hosted deployments, follow embedding setup.
Overview
Chart embedding displays a single saved chart with a minimal, focused interface — a clean, distraction-free view of one visualization, scoped to that chart alone. By default, chart embeds are read-only: viewers can’t change the configuration, apply filters, or reach Explore.When to use chart embedding
- Single KPI displays: show one key metric or visualization
- Embedded widgets: add analytics widgets to application pages
- Minimal UI: a clean, focused display with no dashboard chrome
- Scoped access: grant access to specific charts, not entire dashboards
How it differs from dashboard embedding
Chart embeds support all chart types (bar, line, pie, table, big number, and so on), parameterized charts with their saved values, and — when enabled in the JWT — viewing underlying data. For CSV and image export, see Limitations.
Set up a chart embed
Follow the embedding quickstart for the shared setup: create an embed secret and generate tokens from your backend. The chart-specific part is the allowlist — each chart must be added individually under Settings → Embed before it can be embedded.
Embed with an iframe
iframe embedding needs no libraries or CORS setup. Put the project UUID and the chart UUID in the path and the JWT in the hash fragment. The token’scontent.contentId must match the chart UUID in the URL.
theme, backgroundColor, and timezone), responsive and dynamic sizing, token refresh, and troubleshooting.
Embed with the React SDK
Render a chart withLightdash.Chart, passing the chart UUID and a server-generated token:
Configure what viewers can do
A chart token is scoped to one chart viacontent.contentId (the saved chart UUID). Inside content, you can allow CSV export, image export, and viewing underlying data. For the full schema, see the chart token in the embedding reference.
userAttributes don’t meet the required attributes of the chart’s model, the embed shows Error loading chart with an authorization message.
Edit and drill down
To let viewers edit the chart or drill into its data, add awriteActions claim whose write spaces include the chart’s space, make sure the write actor can update the chart, and pass isEditMode to Lightdash.Chart. The chart then renders in Explore: isEditMode={true} opens it for editing, and isEditMode={false} lets viewers click a data point and Drill into it, with a Back to Chart button. See Edit and drill into a chart.
Limitations
Chart embeds are single-scope. Without edit mode, viewers cannot modify dimensions, metrics, or visualization type, drill down, or reach the Explore view. In every mode, viewers can’t apply filters through the SDKfilters prop or access any content beyond the chart named in contentId.
A chart embed renders only the visualization, with no header or toolbar, so canExportCsv and canExportImages have no button to act on. View underlying data works, since viewers open it from the chart’s data points. To give viewers CSV and image export, add the chart as the only tile on a dashboard and embed that dashboard instead; dashboard tiles keep their export menu.
If you need interactive filters or exploration, use dashboard embedding instead, or reach out with your use case.
Example: single KPI widget
Drop a key metric into your own layout and let the chart background go transparent so it inherits your styling:user metadata in the token to attribute queries in usage analytics, and userAttributes for row-level security. Styling and localization props are covered in the React SDK reference.