Column chart
This chart displays the values of one or more measures by period or category. The height of a column determines the measure value: the higher the column, the larger the value.
Unlike line charts, this type of chart assumes that different periods are compared directly and an emphasis is made on a measure's individual value rather than its general trend.
Source table
Year | Sales |
---|---|
2022 | 6М |
2021 | 28М |
2020 | 18М |
2019 | 9М |
2018 | 1М |
Types of column charts
Grouped
A chart with grouping lets you compare two or more measures: for example, the number of products delivered and the number picked up. The column height corresponds to the measure value.
Source table
Year | Delivery | Pickup |
---|---|---|
2022 | 2М | 4М |
2021 | 8М | 19М |
2020 | 5М | 13М |
2019 | 3М | 6М |
2018 | 331К | 918К |
Stacked
This chart shows the ratio of internal segments by period. Segments are placed one above the other: the base of each subsequent segment is the outermost boundary of the previous one.
Since the sum of all segments is equal to the total length of a column, when column totals are important this type of chart is used.
Source table
Year | Delivery | Pickup |
---|---|---|
2022 | 2М | 4М |
2021 | 8М | 19М |
2020 | 5М | 13М |
2019 | 3М | 6М |
2018 | 331К | 918К |
Wizard sections
Wizard section |
Description |
---|---|
X | Dimensions You can specify one or two dimensions. Affects X-axis value grouping. The order of specified dimensions affects the order of value grouping on the X-axis. For the Date and Date and time types, you can set grouping by time: minutes, hours, weeks, and so on. |
Y | Measure. You can specify multiple measures. If you add more than one measure to a section, the Colors section will contain a dimension named Measure Names. |
Colors | Measure Names dimension or field. Affects the column color. To delete Measure Names, click the cross icon or remove measures from the Y axis. |
Sorting | Dimension or measure. Affects the column sorting. Sorting only applies to dimensions used when building a chart. The sorting direction is marked with an icon next to the field: |
Labels | Measure. Displays measure values on the chart. When using multiple measures for a signature, add Measure Values. Markup functions are supported. For String type fields, you can configure using basic Markdown syntax: click the icon before the field name and enable Markdown. |
Split | Dimension. Splits a chart horizontally by the selected dimension's values. The maximum number of splits per chart is 25. |
Filters | Dimension or measure. Used as a filter. A filter can be overridden by a dashboard selector if the selector is based on the same field. |
Creating a column chart
To create a bar chart:
Warning
If you use a new DataLens object model with workbooks and collections:
- Go to the DataLens home page
. In the left-hand panel, select Collections and workbooks. - Open the workbook, click Create in the top-right corner, and select the appropriate object.
Follow the guide from step 4.
- Go to the DataLens home page
. - In the left-hand panel, select
Charts. - Click Create chart → Chart.
- At the top left, click
Select dataset and specify the dataset to visualize. - Select Bar chart as the chart type.
- Drag a dimension from the dataset to the X section. The values will be displayed in the lower part of the chart on the X axis.
- Drag one or more measures from the dataset to the Y section. The values will be displayed as columns on the Y-axis.
By default, a stacked chart is displayed if you have multiple measures.
Creating a grouped column chart
To display an X-axis grouped column chart:
-
Go to the column chart that you created.
-
Depending on the number of measures in the Y section, follow these steps:
Single measureTwo or more measures- Check if there is a dimension in the Colors section.
- Duplicate this dimension in the X section. The sequence of dimensions affects the grouping order.
- Drag the Measure Names dimension to the Colors section.
- Drag the Measure Names dimension to the X section. The sequence of dimensions affects the grouping order.
Adding a column color based on a measure
To color columns in a chart based on the value of a measure:
-
Go to the column chart that you created.
-
Depending on the number of measures in the Y section, follow the steps below:
Single measureTwo or more measuresCopy the measure from the Y section to the Colors section.
Columns in the chart will take on colors as a function of the measure values.
Drag the Measure Values measure to the Colors section.
The columns in the chart will take on colors depending on the values of all the measures listed in the Y section.
-
Configure a color gradient for the measure as well. To do so, in the top-right corner of the Colors section, click
(the icon is displayed when you hover over the section). -
In the color settings, specify:
- Gradient type: Select two or three colors.
- Gradient color: Select a color palette for the gradient from the list.
- Gradient direction: Change the gradient direction using the
icon. - Set threshold values: Set numeric thresholds for each color. Works if the Y section contains a single value.
null
values
Configuring display of If the source data includes a row where the measure value is null
, the chart will not be built for that point at default settings. For example, if the source has a row with a date (20.07.2022
) but the sales amount for it is missing.
You can configure how the chart will display null values in the chart section settings:
- In the section with a measure whose values you want to show, in the top-right corner, click
(the icon appears when you hover over the section). - In Empty values (null), select
Display as 0
. - Click Apply.
Now, the chart will use 0
instead of null
.
If a row is missing from the source data completely, the chart section settings will not change the way the chart is presented. For example, if the source does not have a row with a certain date (20.07.2022
), nothing will be shown for this date on the chart.
For more information, see Configuring the display of null values.
Recommendations
-
If category values contain a lot of text, try to make it shorter so that chart signatures look neater. You can use string functions in calculated fields or the
CASE
conditional statements. -
If each column is a category rather than a time value, consider sorting the columns in ascending or descending order of the measure. This will make your chart look better and more informative. Sorting may also be helpful inside each column's subcategories.
-
We recommend using a column chart to display changes to a measure or measures over time. In this case, be careful when sorting values on the X-axis, because the user usually expects to see changes over time on the X-axis.
-
When visualizing multiple measures, select colors carefully. They should be distinguishable and contrasting. We recommend using no more than 3-5 colors per chart. If you want to emphasize one certain measure above the others, highlight it in some bright color.
-
You can split a chart by dimension into a number of small charts that are convenient to compare to one another. To do this, drag a dimension from the dataset to the Split section.
Chart example