Charts
Charts are the visualization of data from a dataset in the form of a table, diagram, or map.
DataLens includes two types of charts:
Dataset-based charts
Charts are created in a wizard based on data from one or more datasets (see multi-dataset charts).
You can create an unlimited number of charts based on a single dataset.
The workspace in the wizard interface is divided into three main panels:
- A dataset panel where available fields are displayed: Dimensions and Measures. You can add a calculated field to the list.
- A visualization setup panel that you can use to select a chart type. Each type has its own set of sections (such as X-axis, Y-axis, and filters) where you can drag and drop fields. For more information, see Chart settings.
- A preview panel where the visualization is displayed.
Charts let you quickly analyze and test hypotheses. You can also save charts and add them to dashboards as widgets.
Warning
DataLens limits the number of data rows displayed in charts. For more information, see Quotas and limits in DataLens.
Multi-dataset charts
Multi-dataset charts display data from multiple datasets.
Queries for each dataset are processed independently of each other. You cannot create calculated fields from fields in multiple datasets.
When you add a second DataLens dataset, a link is automatically created based on the first match for the field name and field data type.
In this case, you can:
- Change links.
- Add new links.
- Delete links.
Note
Datas in a chart don't have to be linked.
Features of working with linked datasets in charts, except for geochart layers:
- One chart can use any measures from datasets, regardless of their links.
- One chart can only use linked dimensions.
- Filters by linked dimensions are applied to all datasets.
- Filters by non-linked dimensions are applied only to their own dataset.
Features of working with linked datasets in geovisualizations on different layers:
- A geolayer can use any measures from datasets regardless of their links
- A geolayer can only use its linked dimensions.
- Filters by linked dimensions from the General filters section are applied to all datasets in all layers.
- Filters from the General filters section that use non-linked dimensions only apply to their own dataset in all layers.
- Filters in the Layer filters section that use linked dimensions apply to all datasets within the current layer.
- Filters in the Layer filters section that use non-linked dimensions only apply to their own dataset within the current layer.
- There are no restrictions on using non-linked dimensions in different layers.
QL charts
QL charts are charts created from a connection if the connection source is a database, Prometheus, or Monitoring. To create such charts, direct queries to the source are used. Depending on the chart type, the query can be run in the source database's SQL dialect, as well as the Prometheus or Monitoring query languages. This helps you to expand visualization capabilities by using language-specific transactions.
Running a query does not create a separate Dataset object: a chart is generated on the fly and displayed in the preview panel.
Unlike dataset-based charts, the logic of a visualization area in QL charts favors queries against the source, that is, the visualization area only displays the data queried.
The following types of QL charts are supported:
-
SQL. They let you build visualizations with flexible dataset management based on parameterization of an SQL query to the source DB.
SQL chart specifics:
-
Reduce database workload by using direct queries.
-
Are only suitable for
SELECT
queries. -
Enable the use of
JOIN
,GROUP BY
, andSORT BY
queries and aggregate functions in SQL queries. -
Enable the parameterization of any part of a SQL query.
-
Support a limited set of visualizations types.
-
They do not support RLS and calculated fields.
Query example for a ClickHouse databaseSELECT Category, Month, ROUND(SUM(Sales)) FROM samples.SampleLite WHERE Category in {{category}} -- a variable used in the selector GROUP BY Category, Month -- grouping by category and month ORDER BY Category, Month -- sorting by category and month
-
-
Prometheus. They let you create a chart based on Prometheus data (see the example). You can't build a dataset on top of this source. You can only work with it using QL charts.
-
Monitoring. They let you create a chart based on Yandex Monitoring data (see the example). You can't build a dataset on top of this source. You can only work with it using QL charts. You can also
export
a chart from Monitoring to DataLens. You can edit, save, and place it on a dashboard.
To create a QL chart, see the instructions.
Chart types
You can find all the Yandex DataLens chart types in the Visualization reference.
Versioning
Chart versioning is the ability to store the history of chart configuration changes using versions. A list of versions is available to users with the lowest level of Read access to the chart.
Note
Currently, versioning is only supported for dataset-based charts.
To go to the list of versions, click the
To select a version from the list, click it. The version number will be displayed as the value of the revId
parameter in the chart address string. Clicking on a link with the version number in the revId
parameter will open the relevant version of the chart directly.
Version types
The following distinct versions are available:
-
Actual. The most recently saved version of a chart. All users can see chart versions on dashboards, as well as when directly navigating to charts or opening them for editing from the dashboard context menu. Only one version of a chart can be actual.
If a user has Write permissions, they can make any chart version actual.
Warning
When updating any version, except a draft, a new chart version is created.
-
Draft. A version with unsaved chart changes. The main users do not see changes being made to a draft. This enables you to hide chart edits until a version update. A chart can only have one draft.
To create a draft after editing a chart, click the down arrow in the upper-right corner and select Save as draft.
-
Not actual. A version that is neither actual nor a draft.
Tip
You can share a version of a chart. For this, pass the revision number in the revId
parameter in a link (such as ?revId=zac5m4edoaqqr
).
Creating a new version
A new version is automatically created when you click Save and make actual in chart edit mode. Here are the chart configuration changes that result in a new version:
- Changing chart settings that can be accessed by clicking
at the top of the screen. - Adding, renaming, or deleting chart fields.
- Adding or deleting fields in chart sections.
Limitations
- The change history only contains a list of chart versions and includes: version type, save date and time, and the author of the edits.
- Chart versions don't include changes to access permissions (this operation is performed separately from chart edits).
- Versions do not display a list of changes. You can only view the saved status of the chart configuration.
Publishing a chart
You can grant any internet user access to a chart using DataLens Public. This chart becomes public and any user can view it without authorization.
Granting public access to a chart increases the number of DB queries, so keep in mind that the load on the database will increase.
To grant public access to a chart:
Warning
Before publishing any data, make sure that your charts and dashboards don't contain any personal data or trade secrets. Access to published data is not restricted.
- On the navigation page, find the chart and open it.
- At the top of the wizard interface, click
- In the window that opens, enable Access via link. DataLens automatically grants access to related objects.
- Copy the public link and click Apply.
Access management
You can configure chart permissions.
To configure chart permissions:
- On the navigation page, find the chart that you want to change permissions for.
- On the right side, click
- Enter the username in the Add participants field and click Select.
- In the window that opens, select the permission type and click Add.
For more information about types of permissions, see Managing access to DataLens.