Embedding public objects
You can embed published dashboards and charts into a website or app using iframe.
You can configure the features and appearance of the objects being embedded through these parameters:
-
_autoupdate: Sets the auto-update time for dashboards and charts in seconds. By default, these are not updated automatically. The feature only works for the active browser tab. Objects due for auto-update on inactive tabs will be auto-updated when the tab becomes active again. The minimum values are:- 30 seconds for dashboards
- 15 seconds for charts
-
_embedded: Hides the navigation panel. To activate the parameter, set it to1. -
_no_controls: For charts, hides . To activate the parameter, set it to1. -
_theme: Specifies the object's appearance. The possible values are:light: Light theme.dark: Dark theme.
-
_no_scroll: Disables vertical scrolling on dashboards. To activate the parameter, set it to1. -
_lang: For charts, sets the language of the menu that opens when you click . Possible values:ruanden. -
_opened_info: Displays dashboard description (if provided) when you open the dashboard. To activate the parameter, set it to1.
Provide the parameters formatted as <parameter_name>=<value>. For example, to set the auto-update time to 50 seconds, specify _autoupdate=50.
The parameter is added to the object address after the question mark (?). To send multiple parameters, list them separated by & (ampersand), e.g.:
<iframe frameborder="0" src="https://datalens.yandex/bdzix********?_embedded=1&_no_controls=1&_lang=ru&_theme=dark&_autoupdate=50"></iframe>
Getting the embed code
To get the embed code with a preset dashboard or chart design:
- Publish your dashboard or chart.
- Open the dashboard or chart using the public link provided to you.
- In the upper-right corner, click
and select Embed code. - In the window that opens, set up the menu language, theme, and appearance. On the right of the window, copy the link or embed code with the preset design parameters.
Filtering embedded charts
You can apply filtering to embedded charts. To do this, provide the filtering parameters in the chart link.
To set up filtering:
- Add a chart and selector to the dashboard.
- Publish the dashboard.
- Open the dashboard or chart using the public link provided to you.
- Set the required selector values.
- Click
next to the chart on the dashboard and select Embed code. - In the window that opens, set up the menu language, theme, and appearance. On the right of the window, copy the link or embed code with the preset design and filter parameters.
The filter parameters will be added to the chart URL after ?. When providing multiple parameters, they will be separated by & (ampersand).
<iframe frameborder="0" src="https://datalens.yandex/z2uxl5pbztkep?shopid_vj2j=sp-15&shopid_vj2j=sp-18&shopid_vj2j=sp-20&_embedded=1&_no_controls=1&_theme=light&_lang=ru" width="100%" height="400px"></iframe>