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.

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 visually 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
titleWeightenumFont 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

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

- key: BAR_CHART
  apiVersion: "16"
  type: BAR_CHART
  settings:
    displayCondition:
      mode: DISABLED
    orientation: VERTICAL_LEFT
    textSize: 12
    xAxis:
      showTitle: false
      enabled: false
    ignoreFilters: false
    legend:
      position: BOTTOM
      align: CENTER
    dimensionsFirstGroup:
      - displayCondition:
          mode: DISABLED
        color:
          mode: DISABLED
        dbDataType: STRING
        name: Store
        format: STRING
        value:
          mode: FORMULA
          formula: '"store"."Store"'
        formatting: AUTO
        onClick: []
    filters: []
    showHint: true
    filterMode: DEFAULT
    yAxis:
      showTitle: false
      enabled: true
    measures:
      - displayCondition:
          mode: DISABLED
        color:
          mode: AUTO
        dbDataType: INTEGER
        name: Sales Quantity
        format: NUMBER
        value:
          mode: FORMULA
          formula: sum("sale"."Sales Quantity")
        formatting: AUTO
        valueLabel:
          size: 12
          enabled: true
        showLabels:
          enabled: true
          size: 12
      - displayCondition:
          mode: DISABLED
        color:
          mode: AUTO
        dbDataType: INTEGER
        name: Sales Quantity Plan
        format: NUMBER
        value:
          mode: FORMULA
          formula: sum("sale"."Sales Quantity Plan")
        formatting: AUTO
        valueLabel:
          size: 12
          enabled: true
        showLabels:
          enabled: true
          size: 12
    dimensionsSecondGroup: []
    sorting:
      - name: sum (Sales Quantity)
        value:
          mode: IN_WIDGET
          index: 0
          group: measures
        direction: DESC
    chartType: GROUP
    secondDimensionLimit: 50
    title: ""
    titleSize: 14
    stateName: State 1
    firstDimensionLimit: 5
    showTotalLabels:
      size: 12
      enabled: false
    titleColor:
      mode: AUTO
    titleWeight: NORMAL
    showMarkdown: false
    markdownMeasures: []
    markdownText: ""

Was the article helpful?

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