This section outlines how to deploy DataLens locally, connect to a data source, create your first dataset, build multiple charts for data visualization, and place them on a dashboard.
Go to the repository directory and run all the containers required to start DataLens:
cd <path_to_datalens_folder> && \
HC=1 docker compose up
You can run the last command with a parameter for connecting an external database:
METADATA_POSTGRES_DSN_LIST="postgres://{user}:{password}@{host}:{port}/{database}" HC=1 docker compose up
Note
Highcharts is a patented commercial product. If you enable Highcharts in your DataLens instance (with the HC=1 variable), make sure to comply with the license. When Highcharts is disabled, not all visualization types are available.
The first release of the open-source version includes everything you need to try DataLens features in your infrastructure. The repository currently hosts the service core, a set of key connectors (PostgreSQL, ClickHouse®, and YTsaurus), and the main interface components.
Connections contain information about data source access parameters, such as the DB host IP address and port. You can create datasets based on connections.
To create a connection:
In the top-right corner of the workbook, click Create → Connection.
Select a ClickHouse® connection.
In the window that opens, specify the connection parameters:
A dataset describes a set of data and its structure. It is created by connecting to a data source. A dataset is used when creating the following widgets:
In the window that opens, enter the Sales by week name for the new chart and click Save.
Select Area chart as the visualization type.
Replace the product subcategories with the order date on the X-axis. To do this, drag the OrderDate field from Dimensions to the X section and hold it over the ProductSubcategory field until the latter turns red.
Add the product category to the chart. To do this, drag the ProductCategory field from Dimensions to the Colors section.
Display a week by week chart:
Click the calendar icon next to the OrderDate field in the X section.
In the Grouping field, select Rounding → Week.
Click Apply.
Remove sorting by sales: click (the icon appears when you hover over the field) next to the Sales field in the Sorting section.
In the window that opens, enter the Sales by category name for the new chart and click Save.
For the visualization type, select Pie chart.
Add the product category to the chart. To do this, drag the ProductCategory field from Dimensions to the Color section.
Check that the chart includes the sales measure: the Sales field should be located in the Measures section. If it is not there, drag it from under Measures.
Add a measure label:
Drag the Sales field from Measures to the Labels section.
Click the icon to the left of the measure name.
In the window that opens, for Label value, select Percentage and click Apply.
A dashboard is a page or multiple pages that contain widgets. It allows you to group your charts in the same place and add captions and titles to them.
To create a dashboard:
Go to the Quick start workbook by clicking its name in the chart path.
In the top-right corner, click Create → Dashboard.
In the panel at the bottom of the page, select Chart.
In the window that opens, click Select.
Select the Sales by subcategory chart.
Click Add.
Repeat steps 3 through 6 to add the Sales by week and Sales by subcategory charts.
Adjust the size of the charts with your mouse and place them on the dashboard as you prefer.