[Yandex Cloud documentation](../../index.md) > [Yandex DataLens](../index.md) > Charts > [Visualization reference](index.md) > Scatter chart

# Scatter chart ![](../../_assets/datalens/scatter-chart.svg) in Yandex DataLens

A scatter chart shows the relationship between two values (dimensions or measures). Their values are represented as points. 

* A scatter chart always has two axes: the values of one dimension or measure are plotted along the X-axis and those of the other along the Y-axis. A data point that links these two values is displayed at the intersection of the X and Y coordinates.

  These data points can be distributed along the X-axis evenly or unevenly, depending on specific data.

* Use this type of chart if you need to find the dependency between dimensions and measures or show a range of values. For example, the relationship between the average order value and the number of orders for a product.

* You can also represent dependencies on a scatter chart using point sizes. The size of a point depends on the measure value: the higher the value, the larger the point size.

  {% cut "Example" %}

  For example, the size of a point may depend on the discount on a product.

    {% list tabs %}

    - Visualization

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

    - Source table (5 rows)

      Product | Category | Average order value | Number of orders | Discount
      ----|----|----|----|-----|
      Floor cleaner liquid|	Household cleaners|	153.0 | 1 | 0 |
      Multicooker with 40 modes|	Home appliances |	3442.0 | 1 | 0 |
      Liquid detergent for colored clothes|	Household cleaners |	525.0 | 1 | 0 |
      Carpet detergent|	Household cleaners | 463.0 | 1 | 0 |
      Lemon dishwashing liquid|	Household cleaners| 362.0 | 1 | 0 |

      The dataset is built on [Sample ClickHouse](../quickstart.md) connection tables.

    {% endlist %}

    {% endcut %}


* You can use a gradient in a chart by adding a measure to the **Color** section. For example, the higher the product's average check, the darker the point.

  {% cut "Example" %}

  ![scatter-chart](../../_assets/datalens/visualization-ref/scatter-chart/gradient-scatter-chart.png)

  {% endcut %}

## Wizard sections {#wizard-sections}

Wizard<br/> section| Description
----- | ----
X | Dimension or measure. Sets the X-axis value. For `String` type fields, you can configure using basic [Markdown in Yandex DataLens](../dashboard/markdown.md) syntax: click the icon before the field name and enable **Markdown**.
Y | Dimension or measure. Sets the Y-axis value. For `String` type fields, you can configure using basic [Markdown in Yandex DataLens](../dashboard/markdown.md) syntax: click the icon before the field name and enable **Markdown**.
Points | Dimension. Specifies the number of points on the chart.
Point size | Measure. Sets point size depending on the measure value.
Colors | Dimension or measure. Affects the color of points.
Sorting | Dimension. You can only use a dimension from the X axis. Affects the sorting of the X axis. The sorting direction is marked with an icon next to the field: ![image](../../_assets/console-icons/bars-ascending-align-left.svg) for ascending or ![image](../../_assets/console-icons/bars-descending-align-left.svg) for descending. To change the sorting direction, click the icon.
Filters | Dimension or measure. Used as a filter.

## Creating a scatter chart {#create-diagram}

To create a scatter chart:


{% 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](https://datalens.ru/?skipPromo=true). In the left-hand panel, select ![collections](../../_assets/console-icons/rectangles-4.svg) **Collections and workbooks**.


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

Follow the guide from step 4.

{% endnote %}


1. Go to the DataLens [home page](https://datalens.ru/?skipPromo=true).
1. In the left-hand panel, select ![chart](../../_assets/console-icons/chart-column.svg) **Charts**.
1. Click **Create chart** → **Chart**.
1. At the top left, click ![image](../../_assets/console-icons/circles-intersection.svg) **Select dataset** and specify the dataset to visualize. If you do not have a dataset, [create one](../dataset/create-dataset.md#create).
1. Select **Scatter chart** as the chart type.
1. Drag a dimension from the dataset to the **X** section.
1. Drag one or more measures from the dataset to the **Y** section. The values will be displayed as points at the intersection of the X and Y axes.

### Additional options

Also, you can:

* Change the color of points:

  1. Drag a dimension or measure to the **Colors** section.
  1. Click ![](../../_assets/console-icons/gear.svg) and set new colors.

* Resize points:

  1. Drag the measure to the **Point size** section.
  1. Click ![](../../_assets/console-icons/gear.svg) and set the minimum and maximum point sizes for the specified measure.

  {% note info %}

  A scatter chart isn't suitable for visualization of data over time.

  {% endnote %}

* Specify an additional dimension. To do this, drag a dimension to the **Points** section.

### Configuring display of null values {#null-settings}

* If the source data has a row with `null` for a measure value, this point will not be plotted on a chart with default settings.

    _For example, if the source has a row with the date, `20.07.2022`, but the sales total for it is not specified._

    To set up null value display on a chart:

    1. Click ![image](../../_assets/console-icons/gear.svg) in the top-right corner of the section with the measure you want to configure (the icon appears when you hover over the section).
    1. In **Empty values (null)**, select `Display as 0`.
    1. Click **Apply**. Now the chart will use `0` instead of `null`.

* If a row is missing from the source data altogether, the chart section settings will not change the chart. 

    _For example, if the source does not have a row with the particular date, `20.07.2022`, nothing will be shown for this date on the chart._

For more information, see [Configuring the display of null values in a Yandex DataLens chart](../operations/chart/chart-null-settings.md).

## Recommendations {#recomendations}

* **Labels.** If the category values are too verbose, make them shorter so that the chart labels look neater.
  
  You can use string functions in calculated fields or the [CASE](../function-ref/CASE.md) conditional statements.
* The axis scale often varies and may start with a value other than 0. Pay attention to value signatures.
* **Colors**. When visualizing multiple measures, select colors carefully. They should be distinguishable and contrasting.

#### Useful links {#see-also}

* [Creating a dashboard in Yandex DataLens](../operations/dashboard/create.md)
* [Adding a chart to a dashboard in Yandex DataLens](../operations/dashboard/add-chart.md)
* [Adding a selector to a dashboard in Yandex DataLens](../operations/dashboard/add-selector.md)