Charts are the visualization of data from a dataset in the form of a table, diagram, or map.
DataLens includes two types of charts:
Charts are created in a wizard based on data from one or multiple 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. Learn more in 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.
DataLens limits the number of data rows displayed in charts. Read about them in the section Quotas and limits.
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 dataset DataLens, the 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.
Datasets used in the chart may be non-linked.
Specifics of working with linked datasets in the chart, 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.
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.
SQL charts are charts created from a connection if the connection target is a database. Use a SQL query to build these charts. The query is executed using the original database's SQL flavor, which helps expand visualization capabilities by using database-specific transactions.
Executing a SQL query does not set up a separate Dataset object, but rather generates one on the fly and displays it in the preview panel.
Unlike regular charts, the logic of using the wizard in SQL charts favors the SQL query, that is, the wizard only displays data from a query.
SQL chart features:
- They reduce database workload by using direct queries.
- They are only suitable for
- They enable the use of the
GROUP BY, and
SORT BYoperators as well as aggregate functions in a SQL query.
- They enable the parameterization of any part of a SQL query.
- They support a limited set of visualizations types.
- They have public access restrictions.
- They do not support data materialization or publication.
- They do not use RLS or calculated fields.
SELECT 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
To create a SQL chart, see the instructions.
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.
To grant public access to a chart:
- 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.
- Publishing SQL charts is not supported.
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 the related objects.
You should materialize the dataset that the object is based on.
If the data source is a ClickHouse DB in Yandex.Cloud, then materialization is not required.
Copy the public link and click Apply.
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 and select Configure access.
- 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.