Public chart with a map of Moscow from a CSV file
You can use DataLens to grant public access to your charts and dashboards.
Warning
Before publishing your own data, make sure that your charts and dashboards do not contain personal data or trade secrets. Access to published data is not restricted.
In this tutorial, we will use DataLens to visualize and publish Moscow population metrics on the map of Moscow districts.
We will use the Moscow Population 2018.csv
To visualize and explore data, set up DataLens and follow the steps below:
- Create a connection.
- Create a dataset.
- Create a chart with a map of Moscow districts.
- Publish the chart.
Getting started
To get started with DataLens:
- Log in
to your Yandex account. If you do not have an account, create one. - Open the DataLens home page
. - Click Open DataLens.
- Confirm that you have read the Terms of use
and click Log in.
-
Log in
to your Yandex account. -
Open the DataLens home page
. -
Click Open DataLens.
-
Select one of the options:
-
If you already have an organization, select it from the drop-down menu in the Organizations tab and click DataLens.
Note
To activate a DataLens instance, the user must have the
admin
orowner
role. For more information about roles, see Access management in Yandex Cloud Organization. -
If you have a cloud but no organization, click Add new DataLens. In the window that opens, enter your organization's name and description and click Create organization and DataLens. For more information about working with organizations, see Getting started with organizations.
-
If you have any technical questions about the service, contact Yandex Cloud support
Step 1. Create a connection and dataset
Create a dataset based on the Files connection type.
-
Go to the DataLens
interface. -
In the left-hand panel, select
Connections and click Create connection. -
Select the Files connection type.
-
Click Upload files and select the file to be uploaded. For this example, use Moscow Population 2018.csv (download link
). It may take up to several minutes to load it, depending on the speed of your internet connection.Once loading is compete, you will see a preview of the file data. To view it, use the scroll bars on the right and at the bottom.
-
In the top-right corner, click Create connection.
-
Enter
Moscow Population 2018
as the connection name and click Create.
This will create the file connection. The data will be shown in the same form as in the file. To use it, you need to create a dataset.
-
Click Create dataset.
Step 2. Create a dataset
-
If the workspace is empty, drag the Moscow Population 2018.csv spreadsheet from the selection panel to the workspace.
-
Go to the Fields tab.
-
For the Area, Population, and Housing stock fields, specify Sum as the aggregation type.
The fields with the defined aggregate functions become measures and change their color to blue.
-
For the District coordinates field, change the data type to Geopolygon.
-
In the top-right corner, click Save.
-
In the window that opens, enter Moscow population as the dataset name and click Create.
-
When the dataset is saved, click Create chart.
Step 3. Create a chart with a map of various Moscow districts
-
Select the Map visualization type.
-
Select Polygons (Geopolygons) as the layer type.
-
Add polygons of districts to the map. To do this, drag the Coordinates field from Dimensions to the Polygons (Geoplygons) section.
-
Change the district colors based on the population. Drag the Population field from Measures to the Colors section.
-
In the top-right corner, click Save.
-
In the window that opens, enter Moscow population map by district as the chart name and click Save.
Step 4. Publish the chart
-
Click
and select Public access in the list that opens. -
In the Public access settings window that opens, enable Access via link.
-
Confirm publication of the chart and its linked data.
-
Copy the unique URL of the chart. Click Apply.
-
Open a new tab in the browser and go to the copied link.
You can share this link with your colleagues, partners, and friends. When opening the chart link, authorization and authentication are not required.
Also try:
- Building a column chart by district and population.
- Creating a dashboard with a map, bar chart, and selectors.
- Publishing a dashboard.