Choropleth map in DataLens On-premises

A choropleth map uses different colors and hues for entire areas and regions. Areas on a map are set using geopolygons.

A geopolygon is an element that consists of an area bounded by a closed line and the line itself. The measure value is expressed through color saturation or hue.

​A choropleth map is used to analyze a measure within a territorial unit. For example, you can use a choropleth map to demonstrate the density of population of individual districts.

choropleth-map

To show polygons on a map, add a Geopolygon type field to your dataset:

  • Create a text field with data formatted as [[[55.60807, 37.5698], [55.60847, 37.56992], [55.60851, 37.57095]]] for polygon point coordinates enclosed in square brackets.
    You can first prepare data in a database and set the Geopolygon data type in the dataset description interface.
  • Use the GEOPOLYGON(polygon_string) function to create a calculated field with the Geopolygon data type.

Follow the link to download a sample CSV file with Russian region polygons.

Wizard sections

Wizard
section
Description
Polygons (Geopolygons) Measure of the Geopolygon type
Colors Dimension or measure. Affects the color and intensity of area fill.
Tooltips Dimension or measure. A tooltip that appears when you hover over an area. For String type fields, you can configure using basic Markdown in DataLens On-premises syntax: click the icon before the field name and enable Markdown.
Layer filters Dimension or measure. Used as a filter for the current layer.
Filters Dimension or measure. Used as a filter for the entire chart.

Creating a choropleth map

Warning

If you use the new DataLens object model with workbooks and collections:

  1. Go to the DataLens home page.

  2. Open the workbook, click Create in the top-right corner, and select the object you need.

Follow the guide from step 4.

  1. Go to the DataLens home page.

  2. In the left-hand panel, select Charts.

  3. Click Create chartChart.

  4. At the top left, click Select dataset and specify the dataset to visualize. If you do not have a dataset, create one.

  5. Select Map for the chart type.

  6. Select Polygons (Geopolygons) as the layer type.
  7. Drag a dimension of the Geopolygon type from the dataset to the layer type selection section.
  8. Color the polygons on the map. Move the measure or dimension to the Colors section.
  9. Add tooltips to show the dimension and measure values when hovering over a polygon.

Note

You can show a particular area on the map using the Center and Scale settings.

You can also:

  • Add, rename, and delete a layer.
  • Reorder the layers within a layer type.
  • Apply a filter to the entire chart or one layer.

Recommendations

  • Do not use a choropleth map to precisely compare some values.
  • To make the comparison more precise, add data signatures or tooltips with information to the map.

Useful links