This chart displays the values of one or more measures by each category, using horizontal bars. The length of a bar determines the measure value: the longer the bar, the larger the value. For example, you can compare sales of products by their subcategory.
|Beauty and health products||44К|
|Health and beauty equipment||1760К|
Types of bar charts
A chart with grouping by dimension lets you compare two or more categories by a single measure. For example, with grouping by delivery type you can compare the cost of products delivered by a courier to those with pickup. Categories are highlighted in different colors and the length of the bar indicates the measure value.
|Beauty and health products||12К||32К|
|Health and beauty equipment||497К||1263К|
Use a chart with grouping to compare two or more measures, such as the number of orders and the number of products. The bar length corresponds to the measure value.
|Subcategory||Orders||Number of products|
|Beauty and health products||481||1470|
|Health and beauty equipment||863||2705|
A stacked chart shows a ratio of internal segments to the total value. Segments are placed one after another: the beginning of each subsequent segment is the outermost boundary of the previous one.
This type of chart is used to see the contribution of each measure to the total value by period or category. For example, to view the percentage of different expenses in the total budget amount.
Sections in the wizard
in the wizard
|Y||Dimensions. One or two dimensions can be specified.|
|X||Measure. You can specify multiple measures. If you add more than one measure to a section, the Colors section contains a dimension named Measure Names. You may move Measure Names to the Y-axis.|
|Colors||Dimension or the Measure Names field. Affects the color of bars. Measure Names is deleted by clicking the cross icon or removing measures from the X-axis.|
|Sorting||Dimension or measure. Affects the sorting of columns.|
|Signatures||Measure. Displays measure values on the chart. If multiple measures are added to the Y section, drag Measure Values to this section.|
|Chart filters||Dimension or measure. Used as a filter.|
Creating a bar chart
To create a bar chart:
- On the DataLens home page, click Create chart.
- Under Dataset, select a dataset for visualization.
- Select Bar chart as the chart type.
- Drag one or more dimensions from the dataset to the Y section. The values are displayed on the Y-axis.
- Drag one or more measures from the dataset to the X section.
- Drag a dimension from the dataset or the Measure Names field to the Colors section.
A stacked column chart is displayed by default.
Creating a grouped bar chart
To display an Y-axis grouped bar chart:
Go to the bar chart that you created.
Depending on the number of measures in the X section, follow these steps:One measureTwo or more measures
- Check if there is a dimension in the Colors section.
- Duplicate this dimension in the Y section. The sequence of dimensions affects the grouping order.
Adding a bar 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 X section, follow the steps below:One measureTwo or more measures
Copy the measure from the X 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 on the chart will take on colors depending on the values of all the measures listed in section X.
Configure a color gradient for the measure as well. To do this, in the top right-hand corner of the Colors section, click (the icon is displayed when you mouse over the section).
In the color settings, specify:
- Gradient type: Select 2 or 3 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 X section contains a single value.
Configuring the display of
If the source data includes a row where the measure value is
null, this point won't be shown on the chart at default settings. For example, if the source includes a row with a date (
20.07.2022) but the sales amount is missing for it.
You can use settings for chart sections to show null values:
- In the section with a measure whose values you want to show, in the upper-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
If a row is missing in the source data, the chart section settings won't affect the measure display on the chart. For example, if the source data doesn't 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.
If the values of the categories contain a large amount of text, try to reduce it. Then the signatures on the diagram will look more accurate. You can use string functions in the calculated fields or conditional operators CASE.
- Place segments inside bars so that the largest or most important categories are located to the left, closer to the chart's Y-axis. This makes it easier to compare the values.
- 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.