Top.Mail.Ru
Bar Chart
CTRL+K

Bar Chart

In this article
  • Bar Chart
  • Widget Settings
  • Data Settings
  • Display Settings
  • Filtering Settings
  • Widget Configuration in YAML
  • Data Settings in YAML
  • Display Settings in YAML
  • Filtering Settings in YAML
  • Example of a Configured Widget in the YAML Editor

In a Bar Chart, data is represented as vertical or horizontal bars, where the height or width is proportional to the displayed values. Each bar corresponds to a distinct data value or category.

Bar chart example

Widget Settings

In addition to the common widget settings, this widget has unique configuration options.

Data Settings

The widget supports two dimension groups: Dimension 1 and Dimension 2. You can add multiple dimensions to each group. For dimensions, you can hide empty values, assign click actions, and configure the Display setting (Always / By variable / By formula). You can also add measures to the widget.

You can assign colors to dimensions and measures. Display rules applicable to the widget are defined either at the workspace level in the Data Model or in the dashboard’s indicator tab under Dashboard.

Note

The availability of color configuration modes for dimensions and measures depends on the widget’s configuration.

1 Dimension2 Dimensions
1 MeasureFor the dimension, available modes:
1. Disabled
2. By values (only rules with Solid mode are allowed)
3. By rule (only dimension-based rules added to the widget are allowed)

For the measure, allowed rule modes:
1. Solid
2. By measure
3. Custom
For Dimension 1:
Color settings unavailable

For Dimension 2, available modes:
1. Disabled
2. By values (only rules with Solid mode are allowed)
3. By rule (only rules for the dimension added to the widget are allowed)

For the measure:
Color settings unavailable
Multiple MeasuresFor the dimension:
Color settings unavailable

For measures, allowed rule mode:
1. Solid
Invalid widget configuration

As with other widgets, you can apply sorting to the Bar Chart.

Advice

If your Bar Chart uses two dimensions, sorting by total value may display incorrectly. To ensure correct total-value sorting, use the formula: any(process(count("dimension_2"), "dimension_1")). This formula calculates the full range of values and enables proper ascending or descending sorting.

Display Settings

Text Size

Controls the text size in the widget, excluding measure Data labels.

Dimension Limits

Dimension 1 Limit and Dimension 2 Limit control the number of bars displayed on the chart.

Hide Empty Values

Enable this option to exclude empty values from the chart.

Hint

When enabled, hovering over a bar in Browse mode displays a hint with detailed information about the data. This is especially useful when the chart contains many bars and not all labels are visible.

Chart Type

Controls how bars are displayed: Stacked (default) or Grouped. When using stacked bars, you can optionally show total Data labels and adjust their text size.

Orientation

Controls the direction of the bars:

  • Auto (default)
  • Vertical
  • Vertical-left
  • Vertical-right

If the dimension uses a time-based format, the chart orientation is vertical; otherwise, it defaults to horizontal.

Bar Width

Default: Auto (20 pixels for horizontal orientation, 36 pixels for vertical). Acceptable values: 12–100 pixels. The input value is used as the maximum bar width if sufficient space is available (gaps between bars are at least as wide as the bars themselves). If space is limited, the system automatically reduces bar width to fit.

Note

When bars are displayed in Grouped mode, the width setting applies uniformly to all bars.

Legend

For details on legend configuration, see Widgets.

X-Axis

For the X-axis, you can enable a title and configure label rotation and height.

Y-Axis

For the Y-axis, you can enable a title and set label width.

Note

You can independently enable or disable either axis.

Reference Lines

Reference lines serve as visual guides for specified values on a chart. Detailed information on configuring and using reference lines is provided on the Widgets page.

Filtering Settings

The widget supports standard filtering settings.

Filters configured within the widget cannot be removed in Browse mode.

Widget Configuration in YAML

You can configure the widget not only in the view but also in the YAML editor. The table below lists the keys and values available for configuration. For details on using the value key, see Dimension and Measure Values in YAML. Supported data formats are described on the corresponding page. General widget parameters are covered in Widget Configuration in YAML.

Data Settings in YAML

KeyTypeDefinition
titlestringTitle
showMarkdownbooleanDescription
markdownTextstringDescription text
markdownMeasuresMeasures in description
dimensionsFirstGroupDimension 1
dimensionsSecondGroupDimension 2
measuresMeasures
sortingSorting

Dimension 1 (key: dimensionsFirstGroup)

KeyTypeDefinition
namestringIndicator title
valueEvent indicator formula
dbDataTypeenumEvent indicator data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only for CUSTOM formatting
hideEmptyValuesbooleanHide empty values
hierarchyDimensionsHierarchy dimensions
If added, the indicator is defined as a hierarchy
onClickClick actions
Not applied if hierarchical
colorColor:
- DISABLED — disabled
- VALUES — by values
- RULE — by rule
Not applied if:
1. Dimension 2 group is used
2. Multiple measures are defined
3. Indicator is hierarchical
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting
Hierarchical Dimension for Dimension 1 (key: hierarchyDimensions)
KeyTypeDefinition
namestringEvent title
valueIndicator formula
dbDataTypeenumFormula data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only for CUSTOM formatting
hideEmptyValuesbooleanHide empty values
onClickClick actions
colorColor:
- DISABLED — disabled
- VALUES — by values
- RULE — by rule
Not applied if:
1. Dimension 2 group is used
2. Multiple measures are defined
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting

Dimension 2 (key: dimensionsSecondGroup)

KeyTypeDefinition
namestringIndicator title
valueEvent indicator formula
dbDataTypeenumEvent indicator data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only for CUSTOM formatting
hideEmptyValuesbooleanHide empty values
hierarchyDimensionsHierarchy dimensions
If added, the indicator is defined as a hierarchy
onClickClick actions
Not applied if hierarchical
colorColor:
- DISABLED — disabled
- VALUES — by values
- RULE — by rule
Not applied if:
1. Dimension 2 group is used
2. Multiple measures are defined
3. Indicator is hierarchical
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting
Hierarchical Dimension for Dimension 2 (key: hierarchyDimensions)
KeyTypeDefinition
namestringEvent title
valueIndicator formula
dbDataTypeenumFormula data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only for CUSTOM formatting
hideEmptyValuesbooleanHide empty values
onClickClick actions
colorColor:
- DISABLED — disabled
- VALUES — by values
- RULE — by rule
Not displayed if Dimension 1 is empty and multiple measures are defined
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting

Measures in YAML (key: measures)

KeyTypeDefinition
namestringMeasure title
valueMeasure formula
dbDataTypeenumMeasure data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only for CUSTOM formatting
showLabelsShow Data labels
colorColor:
- AUTO — auto
- BASE — solid
- GRADIENT — gradient
- RULE — by rule
- FORMULA — by formula
Not applied if both dimension groups are used
displayConditionDisplay (display condition)
Show Value Labels (key: showLabels)
KeyTypeDefinition
enabledbooleanEnable/disable labels
sizenumberLabel size

Display Settings in YAML

KeyTypeDefinition
paddingsstringSide paddings
titleSizenumberTitle size
titleColorTitle color:
- AUTO — auto
- BASE — solid
titleWeightenumTitle font weight:
- NORMAL — normal
- BOLD — bold
markdownTextSizenumberMarkdown description text size
Available only if Description is enabled
textSizenumberText size
firstDimensionLimitnumberDimension 1 limit
secondDimensionLimitnumberDimension 2 limit
hideEmptyValuesbooleanHide empty values
showHintbooleanHint
chartTypeenumChart type:
- STACK — stacked
- GROUP — grouped
orientationenumOrientation:
- AUTO — auto
- HORIZONTAL — horizontal
- VERTICAL-LEFT — vertical-left
- VERTICAL-RIGHT — vertical-right
legendLegend
showTotalLabelsTotal Data labels
Only for STACK type
xAxisX-axis settings
yAxisY-axis settings
barWidthnumberBar width

Total Value Labels (key: showTotalLabels)

KeyTypeDefinition
enabledbooleanEnable/disable total labels
sizenumberLabel size

X-Axis Settings (key: xAxis)

KeyTypeDefinition
enabledbooleanEnable/disable X-axis
rotationnumberLabel rotation
heightnumberLabel height
showTitlebooleanTitle

Y-Axis Settings (key: yAxis)

KeyTypeDefinition
enabledbooleanEnable/disable Y-axis
widthnumberLabel width
showTitlebooleanTitle
Reference Lines (key: referenceLines)

To add reference lines to the Y-axis, use the referenceLinesEnabled key.

KeyTypeDefinition
referenceLinesEnabledbooleanReference lines toggle

Within the referenceLines block, the following keys are used:

KeyTypeDefinition
namestringName
colorBlock for configuring the reference line color. The mode key specifies the coloring mode:
- AUTO — automatic
- BASE — solid

If BASE is selected, the HEX color code must be provided in the value key within double quotes, e.g., "#e51320"
typeenumLine type:
- SOLID — solid
- DOTTED — dotted
dashLengthnumberDash length (configurable only for DOTTED lines)
thicknessnumberLine thickness (range: 0 to 20)
formulastringFormula (must be enclosed in double quotes, e.g., "400")

Filtering Settings in YAML

KeyTypeDefinition
filterModeenumFilter mode:
- DEFAULT — default
- SINGLE — single selection
- DISABLED — disabled
ignoreFiltersbooleanIgnore filters
filtersFilters
aggregateFiltersAggregate filters
stateNamestringState

Example of a Configured Widget in the YAML Editor

widgets:
  - key: bar-chart
    apiVersion: "17"
    type: BAR_CHART
    settings:
      titleColor:
        mode: AUTO
      titleSize: 14
      paddings: 8
      titleWeight: NORMAL
      textSize: 12
      filterMode: DEFAULT
      ignoreFilters: false
      stateName: null
      title: ""
      showMarkdown: false
      markdownMeasures: []
      markdownText: ""
      markdownTextSize: 14
      showTotalLabels:
        enabled: false
        size: 12
      xAxis:
        enabled: true
        showTitle: true
        referenceLinesEnabled: false
      yAxis:
        enabled: true
        showTitle: true
        referenceLinesEnabled: false
      firstDimensionLimit: 15
      secondDimensionLimit: 50
      dimensionsFirstGroup:
        - name: trimmed_name
          value:
            mode: FORMULA
            formula: '"phases"."trimmed_name"'
          dbDataType: String
          formatting:
            value: AUTO
            mode: BASE
          hideEmptyValues: false
          format:
            value: STRING
            mode: BASE
          onClick: []
          displayCondition:
            mode: DISABLED
          color:
            mode: DISABLED
      dimensionsSecondGroup:
        - name: action_type
          value:
            mode: FORMULA
            formula: '"phases"."action_type"'
          dbDataType: String
          formatting:
            value: AUTO
            mode: BASE
          hideEmptyValues: false
          format:
            value: STRING
            mode: BASE
          onClick: []
          displayCondition:
            mode: DISABLED
          color:
            mode: DISABLED
      measures:
        - name: Amount
          value:
            mode: FORMULA
            formula: count()
          dbDataType: UInt64
          formatting:
            value: AUTO
            mode: BASE
          format:
            value: NUMBER
            mode: BASE
          showLabels:
            enabled: true
            size: 12
          color:
            mode: AUTO
          displayCondition:
            mode: DISABLED
      chartType: STACK
      orientation: AUTO
      legend:
        position: BOTTOM
        align: CENTER
        verticalAlign: TOP
        width:
          mode: PIXEL
          value: null
      filters: []
      barWidth: null

Was the article helpful?

Yes
No
Previous
Combined Bar Chart
We use cookies to improve our website for you.