[Yandex Cloud documentation](../../index.md) > [Yandex DataLens](../index.md) > Troubleshooting > [FAQ](index.md) > Charts

# Charts


### How do I display only the top 10 values in a chart?

1. Create a new field with the `rank([name of the field for the TOP N selection]])` or `rank_dense` formula.
1. Add this field to the chart filters and specify `≤ N` as the filtering criterion.

### How do I create labels by dimension in a pie chart (so that measure names become the labels for the pie chart sectors)? {#how-to-create-labels-in-pie-chart}

In the chart, add the **Measure names** dimension to the **Signatures** section.

See the [legend example](https://storage.yandexcloud.net/doc-files/masure-names.png).

### Can I hide a legend in charts? {#hide-legend-in-chart}

You can configure the chart settings to hide the legend.

1. Go to the chart.
1. On the top panel, click ![](../../_assets/console-icons/gear.svg).
1. Disable **Legend**.

### How do I add two measures to the Label section in a line chart? {#how-to-add-two-indicators}

Add the **Measure Values** field to the **Labels** section.

### How do I label each column in a column chart that contains multiple measures with its own measure value? {#how-to-add-columns-signatures}

Add the [Measure Values](../concepts/chart/measure-values.md) measure to the **Labels** section.

### How do I create a grouped column chart? {#how-to-create-grouped-column-chart}

By default, a stacked column chart is displayed (see [the screenshot](https://storage.yandexcloud.net/doc-files/bar-chart.png)).

Follow [this guide](../visualization-ref/column-chart.md#grouped-column-chart) to display a grouped column chart.

### How do I create a column chart grouped by multiple columns? {#add-column-grouped}

To display a column chart grouped by multiple columns:

1. Drag the **Measure Names** dimension to the **Colors** section.
1. Drag the **Measure Names** dimension to the **X** section. The order of dimensions will affect the grouping order.

### How many measures can I add to the **Colors** section for **Table** or **Pivot table** charts? {#number-of-indicators-in-color-section}

You can add only one measure to the **Colors** section.

### How do I create a chart with all columns without dragging them all manually? {#add-all-fields}

You cannot add all data fields at once to a chart section. Add each field with one of the following methods:

* Drag a field to the relevant chart section.
* Click ![image](../../_assets/console-icons/plus.svg) in the relevant section (the icon appears when you hover over the section) and select a field.

### Is it possible to display a line chart and columns in the same chart at the same time? {#line-chart-with-columns}

To display different types of charts in the same chart at the same time, use a [combined chart](../visualization-ref/combined-chart.md).

### How do I make a signature with both the sector name and percentage in a pie chart? {#pie-chart-note}

Create a signature using a calculated field:

`[<name>] + ' ' + STR(INT(SUM([<value>])/SUM(SUM([<value>]) TOTAL) * 100)) + '%'`

Where:

* `<name>`: Field for the sector name.
* `<value>`: Field to show as a percentage.

**How does the formula work?**

1. The `SUM([<value>])/SUM(SUM([<value>]) TOTAL) * 100` part calculates the sector's percentage.
1. The calculated value is rounded by the [INT](../function-ref/INT.md) function.
1. The value is converted to a string using the [STR](../function-ref/STR.md) function to create labels on the chart.
1. The sector name, calculated value, and the `%` character are concatenated into a string using the addition operator, `+`.

Alternatively, you can use a formula with an [LOD expression](../concepts/lod-aggregation.md#fixed):

`[<name>] + ' ' + STR(INT(SUM([<value>])/SUM([<value>] FIXED) * 100)) + '%'`

You will get the same result as with the first formula. Try both and pick the one that works best for you.

**Example**

Formula: `[Category] + ' ' + STR(INT(SUM([Sales])/SUM(SUM([Sales]) TOTAL) * 100)) + '%'`

See the [screenshot](https://storage.yandexcloud.net/doc-files/pie-chart.png).

### How do I create a logarithmic scale on a line chart? {#make-logarithmic-scale}

To select the axis type:
1. Go to the chart.
1. Make sure all the fields in the **X** axis section have the **Fractional number** type.
1. Open the **X** axis settings.
1. In the **Axis type** field, select **Logarithmic**.

If you select the **Logarithmic** axis type and then change the data type to **Integer** or add fields with a different data type, the axis type will not change.

To select the **Linear** axis type again, change all the fields in the axis section to fractional numbers, then select the **Logarithmic** axis type, and go back to the data types you need.

### How do I create a signature only for the last point on the chart? {#sign-last-point}

Create a new measure using a formula. To create a signature only for the last point, the formula is as follows:

```
if(
    max([Order Date]) = max(max([Order Date]) total), --if the point date is the maximum date for the chart
    [Sales], --then output the value of the Sales measure
    null --else, show no signatures for any other dates
)
```

[Chart example](https://storage.yandexcloud.net/doc-files/line-chart.png)

For a line chart, you can drag-and-drop only measures, including the [Measure Values](../concepts/chart/measure-values.md) measure, to the **Signatures** section.

If you move the same measure in the **Y** axis section to the **Signatures** section, you will see signatures on the chart (see the [screenshot](https://storage.yandexcloud.net/doc-files/signatures.png)).

### How do I label multiple lines on a chart? {#sign-multiple-lines}

If a line chart only contains a single measure in the **Y** or the **Y2** section, drag this measure to the **Signatures** section.

If a line chart contains two or more measures in the **Y** or the **Y2** section, drag the **Measure Values** measure to the **Signatures** section.


{% cut "Example of a proper label with the Measure Values measure in the Signatures section" %}

![correct](../../_assets/datalens/qa/sign-multiple-lines-correct.png)

{% endcut %}

### How do I change a column width in a table? {#resize-column}

To change a column width in a table:

1. In the top-right corner of the **Columns** section, click ![image](../../_assets/console-icons/gear.svg) (the icon appears when you hover over the section).
1. In the **Column width** window that opens, [set up the width](../visualization-ref/table-chart.md#set-column-width) of each column.

### How do I change a column header in a table? {#rename-column}

1. Under **Columns**, click the icon to the left of the dimension or measure name.
1. In the window that opens, change the **Name** field value and click **Apply**.

### Why does a line connect points with missing values in-between and Display as 0 enabled? {#null-setting-in-charts}

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. On the chart, it will appear as a line gap, skipped column or point. For example, if the source has a row with the date, `20.07.2022`, but the sales total for it is not specified.

You can configure how the chart will display null values in the chart section settings:

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, `null` values will be replaced by `0` in the chart.

{% note info %}

This setting is only available for charts that have at least one **X** or **Y** axis:

* Line chart
* Area chart (stacked and normalized)
* Column chart (including normalized)
* Bar chart (including normalized)
* Scatter chart

{% endnote %}

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. The values of fields with missing values in-between will be connected by a line.

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



### Why do I get null output when creating a multi-dataset chart? {#null-in-multidataset-chart}

The possible causes might include the following:

* The `null` value is saved in the database table.
* When joining tables, you get the `null` values if one of the tables is lacking the entries that match the other table's entries according to the joining condition.

If values other than `null` must be displayed for each dataset:

* Make sure you have selected the correct fields when setting up links between datasets.
* Make sure there are no filters in place in the chart or dataset that could limit the resulting selection to data from a single dataset. Remove the filters and check how entries are displayed.
* Check the conditions that are limiting the selection (if an SQL query is used to build the dataset).
* Check alignment between entries from different datasets. Do it by selecting an entry from one dataset and finding a matching entry in the other dataset according to the joining condition. Make sure that values other than `null` are displayed in each dataset in the fields used to build your [multi-dataset chart](../operations/chart/create-multidataset-chart.md).