Publishing a chart with a map from a CSV file to DataLens Public
You can use DataLens to grant public access to your charts and dashboards.
Before publishing your own data, make sure that your charts and dashboards don't contain personal data or trade secrets. Access to published data is not restricted.
In this scenario, the population measure will be visualized on the Moscow district map and published to DataLens Public using DataLens.
To visualize and publish your data, follow these steps:
- Before you start.
- Create a connection.
- Create a dataset.
- Create a chart with a map of the Moscow districts.
- Publish the chart in DataLens Public.
Before you start
To use DataLens, you have to sign up for Yandex.Cloud and create a billing account (without a billing account, DataLens is only available in demo mode):
- Go to the management console. Then log in to Yandex.Cloud or sign up if don't already have an account.
- On the billing page, make sure you linked a billing account, and it has the
TRIAL_ACTIVEstatus. If you don't have a billing account, create one.
When you activate your billing account, you automatically switch to the Free DataLens plan. By default, you can create a DataLens instance for no more than 1 folder. If you haven't done this yet:
- Select a folder on the Yandex.Cloud page.
- Select the DataLens service.
- Click Activate DataLens.
An instance of the service is created in the selected folder and you can go directly to the DataLens interface.
Step 1. Create a connection and a dataset
Create a dataset based on the connection to the CSV file.
Go to the interfaceDataLens.
Click Create connection.
Click Select CSV file.
Select a file. For this example, use Moscow Population 2018.csv (download link).
Wait until the table content appears on the screen.
After the data is saved, click Create dataset.
Step 2. Create a dataset
Drag the Moscow Population 2018.csv table from the selection panel to the workspace.
Go to the Dataset tab.
For the fields Area, Population, and Housing stock, specify Sum as the aggregation type.
The fields with aggregation functions become measures and become blue.
For the District coordinates field, change the data type to Geopolygon.
Click Save in the upper-right corner to save the dataset.
Enter a name for the dataset: Moscow population, then click Create.
When the dataset is saved, click Create chart.
Step 3. Create a chart with a map of the Moscow districts
Choose the Choropleth map visualization type.
Add polygons of districts to the map. To do this, drag the Coordinates field from the Dimensions section to the Geopolygons section.
Change the district colors based on the population. Drag the Population field from the Measures section to the Colors section.
Click Save in the upper-right corner.
In the window that opens, enter the name Moscow population map by district for the chart and click Save.
Step 4. Publish the chart in DataLens Public
Click the Set up public access icon.
In the public access settings window that opens, enable Access via link.
Confirm that you want to publish the chart and relevant 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 colleagues, partners, and friends. DataLens Public doesn't require authorization or authentication when the user follows the chart link.
- Building a bar map with population density across districts.
- Creating a dashboard with a map, bar chart, and selectors.
- Publishing a dashboard.