---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/visualization-ref/polyline-map-chart
  - ru/visualization-ref/polyline-map-chart
  - href: en/visualization-ref/polyline-map-chart.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/visualization-ref/polyline-map-chart.html
title: Polyline map in DataLens On-premises
description: >-
  In this tutorial, you will learn how to create and customize the polyline map
  visualization type in DataLens On-premises.
vcsPath: en/visualization-ref/polyline-map-chart.md
---

# Polyline map <!-- diplodoc:svg ![](../_assets/datalens/polyline-map.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" d="M3.5 5A1.5 1.5 0 0 1 5 3.5h14A1.5 1.5 0 0 1 20.5 5v14a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 19V5Z"/><path fill="currentColor" d="m3 6.077 8.898 3.595L14.593 3h1.079l-2.847 7.046.001.001-.374.927-1.499 3.709.926.374L21 18.742V19c0 .27-.053.526-.15.76l-9.347-3.776-.925-.373-.374.926-.375.928-.002-.002L8.397 21H7.32l1.58-3.911L3 14.705v-1.078l5.35 2.161.924.374.375-.927.374-.927h.002l1.498-3.709-.926-.374L3 7.155V6.078Z"/><path fill="currentColor" d="M19 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-10 4a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm6 6.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"/></svg> in DataLens On-premises

A polyline map is a type of geolayer on a **Map** chart that lets you draw polylines on the map. A polyline consists of points connected in a certain order. 

A polyline map is used, for example, to show the path of a moving object.

  ![polyline-map-chart](../_assets/datalens/visualization-ref/polyline-map-chart/polyline-map-chart.png =800x)

To build a polyline map, you need the following data:

* Coordinates of line points of the [Geopoint](../dataset/data-types.md#geopoint) data type. Each point of each polyline must be stored in a dataset as a separate row.
* A field or a set of fields to group points into lines (each line's ID).
* A field to sort the order of points in each line (such as a timestamp or point number).

You can color polyline segments in one of the following ways:

* In a gradient by measure (for a example, an average speed in a point).


* In discrete colors by dimension (for example, by trip name).


## Wizard sections {#wizard-sections}

Wizard<br/> section| Description
----- | ----
Polylines	(Geopoints) | Measure of the [Geopoint](../dataset/data-types.md#geopoint) type
Measures	| Measure. The value displayed when you hover over a point.
Grouping	| Dimension. Defines a group of points forming a polyline.
Colors	| Dimension or measure. Affects the intensity of line segment fill. A segment is filled in from the originating point.
Order	| Dimension. Defines the order for connecting points within a group.
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 polyline map {#create-diagram}

To create a polyline map:


<!-- source: en/_includes/datalens/operations/datalens-workbooks-collections-note-step4.md -->
{% note warning %}

If you use the new DataLens object model with [workbooks and collections](../workbooks-collections/index.md):


1. Go to the DataLens home page.


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

Follow the guide from step 4.

{% endnote %}
<!-- endsource: en/_includes/datalens/operations/datalens-workbooks-collections-note-step4.md -->


1. <!-- source: en/_includes/datalens/visualization-ref/create-1.md -->
   Go to the DataLens home page.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-1.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-2.md -->
   In the left-hand panel, select <!-- diplodoc:svg ![chart](../_assets/console-icons/chart-column.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g clip-path="url(#svg-ge35tdgj__a)"><path fill="currentColor" fill-rule="evenodd" d="M11.5 3.5h2a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5m-2.5 9a.5.5 0 0 0 .5-.5V7a.5.5 0 0 0-.5-.5H7a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 .5.5zm-4.5 0A.5.5 0 0 0 5 12v-2a.5.5 0 0 0-.5-.5h-2a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5zm-1 1.5h-1a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h2q.26 0 .5.063V7a2 2 0 0 1 2-2h2q.26 0 .5.063V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2z" clip-rule="evenodd"/></g><defs><clipPath id="svg-ge35tdgj__a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg> **Charts**.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-2.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-3.md -->
   Click **Create chart** → **Chart**.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-3.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-4.md -->
   At the top left, click <!-- diplodoc:svg ![image](../_assets/console-icons/circles-intersection.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.576 11.854a4 4 0 1 1 0-7.707A5.48 5.48 0 0 0 5 8c0 1.5.601 2.861 1.576 3.854M8 12.9a5.5 5.5 0 1 1 0-9.8 5.5 5.5 0 1 1 0 9.8m1.424-8.754A4.003 4.003 0 0 1 14.5 8a4 4 0 0 1-5.076 3.854A5.48 5.48 0 0 0 11 8c0-1.5-.601-2.861-1.576-3.854M8 4.877C8.914 5.61 9.5 6.737 9.5 8s-.586 2.39-1.5 3.123A4 4 0 0 1 6.5 8c0-1.263.586-2.39 1.5-3.123" clip-rule="evenodd"/></svg> **Select dataset** and specify the dataset to visualize. If you do not have a dataset, [create one](../dataset/create-dataset.md#create).
   <!-- endsource: en/_includes/datalens/visualization-ref/create-4.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-5.md -->
   Select **Map** for the chart type.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-5.md -->
1. Select the **Polylines (Geopoints)** layer type.
1. Drag a dimension of the [Geopoint](../dataset/data-types.md#geopoint) type from the dataset to the layer type selection section.
1. Specify a group of points that defines polylines. Move the measure to the **Grouping** section.
1. Define the order for connecting points within the group. Move the measure to the **Order** section.
1. Color the line on the map. Move the measure or dimension to the **Colors** section.

<!-- source: en/_includes/datalens/datalens-map-scale-note.md -->
{% note info %}
              
You can show a particular area on the map using the **Center** and **Scale** [settings](../concepts/chart/settings.md#common-settings).
          
{% endnote %}
<!-- endsource: en/_includes/datalens/datalens-map-scale-note.md -->

<!-- source: en/_includes/datalens/visualization-ref/you-can-2.md -->
You can also:

* Add, rename, and delete a layer.
* Apply a filter to the entire chart or one layer.
<!-- endsource: en/_includes/datalens/visualization-ref/you-can-2.md -->

## Recommendations {#recomendations}

* Reduce the number of route points at the source level if there are too many of them. To do this, use a chart-level filter. This will speed up map loading and rendering.
* Use the [MAVG](../function-ref/MAVG.md) moving average function to smooth measure outliers of individual points/sections. 

  For example, when building a line representing average speed using the `MAVG([speed],2,2)` function, the speed measure values are averaged out in the current point, as well as two points before and two points after it. As a result, the color gradient changes more smoothly.

<!-- source: en/_includes/datalens/visualization-ref/see-also-sub.md -->
#### Useful links {#see-also}

* [Creating a dashboard in DataLens On-premises](../operations/dashboard/create.md)
* [Adding a chart to a dashboard in DataLens On-premises](../operations/dashboard/add-chart.md)
* [Adding a selector to a dashboard in DataLens On-premises](../operations/dashboard/add-selector.md)
<!-- endsource: en/_includes/datalens/visualization-ref/see-also-sub.md -->