Top.Mail.Ru
Donut Chart
CTRL+K

Donut Chart

In this article
  • Donut 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

A donut chart displays data as sectors of a circle, where each sector represents a part of the whole. The sum of all sectors equals 100 %.

Example of a donut chart

Widget Settings

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

Data Settings

You can add one dimension and multiple measures to the widget. Working with local indicators is described on the Dimensions and Measures page.

For measures, you can additionally enable the display of absolute values. For dimensions, you can hide empty values, add click actions, and configure the Display parameter (Always / By variable / By formula).

You can assign colors to both dimensions and measures. Display rules applicable to the widget are defined either at the workspace level in the Data Model or in the indicators tab of the dashboard.

Note

The available color configuration modes for dimensions and measures depend on the widget’s setup.

Without dimensionWith dimension
For the measure, the following modes are available:

1. Solid
For the dimension, the following modes are available:

1. Disabled
2. By values (rules with Solid mode are available for values)
3. By rule (rules based on the added dimension are available for values)

For the measure, the following modes are available:

1. Auto (default)
2. Gradient (to avoid excessive intermediate colors, configure the number of classes—between 3 and 10)
3. By rule (rules with Gradient or Custom mode are available for values)
4. Custom (by formula)

Display Settings

Text Size

Controls the font size of text within the widget.

Dimension Limit

Controls the number of segments displayed on the chart.

Hint

When enabled, hovering over a segment in Browse mode displays a hint with detailed information about the data shown.

Additional Display Settings

Additionally, you can hide empty values and enable the legend for this widget.

Filtering Settings

The widget supports standard filtering settings.

A filter configured within the widget cannot be removed in Browse mode.

Note
  • Values in a donut chart are displayed as percentages.
  • Other is calculated as 100 % minus the sum of all displayed segments.
  • The Other segment is not clickable.

Widget Configuration in YAML

The widget can be edited not only visually but also in the YAML editor. The table below lists the keys and values you can use for configuration. For details on working with the value key, refer to 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
dimensionsDimensions
measuresMeasures
sortingSorting

Dimensions in YAML (key: dimensions)

KeyTypeDefinition
namestringDimension name
valueDimension formula
dbDataTypeenumDimension data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only available for CUSTOM (Custom) formatting
hideEmptyValuesbooleanHide empty values
hierarchyDimensionsHierarchy dimensions
If this parameter is added, the indicator is treated as hierarchical
onClickClick actions
Not applied if the indicator is hierarchical
colorColor:
- DISABLED — Disabled
- VALUES — By values
- RULE — By rule
Not applied if the dimension is hierarchical
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting
Hierarchical Dimension (key: hierarchyDimensions)
KeyTypeDefinition
namestringDimension name
valueDimension formula
dbDataTypeenumDimension data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only available for CUSTOM (Custom) formatting
hideEmptyValuesbooleanHide empty values
onClickClick actions
colorColor:
- DISABLED — Disabled
- VALUES — By values
- RULE — By rule
displayConditionDisplay (display condition)
arrayNestingbooleanArray nesting

Measures in YAML (key: measures)

KeyTypeDefinition
namestringMeasure name
valueMeasure formula
dbDataTypeenumFormula data type
formatenumFormat
formattingenumFormatting
formattingTemplatestringCustom formatting
Only available for CUSTOM (Custom) formatting
showLabelsData labels
colorColor
Available modes without dimension:
- AUTO — Auto
- BASE — Solid
- RULE — By rule
Available modes with dimension:
- AUTO — Auto
- GRADIENT — Gradient
- RULE — By rule
- FORMULA — By formula
displayConditionDisplay (display condition)
Value Labels (key: showLabels)
KeyTypeDefinition
enabledbooleanLabels on/off
absolutebooleanAbsolute values
sizenumberLabel size

Display Settings in YAML

KeyTypeDefinition
paddingsstringSide paddings
titleSizenumberTitle size
titleColorTitle color:
- AUTO — Auto
- BASE — Solid
titleWeightenumFont weight:
- NORMAL — Normal
- BOLD — Bold
markdownTextSizenumberDescription text
Specifies the Markdown description font size. Available only if the Description toggle is enabled
textSizenumberText size
dimensionLimitnumberDimension limit
hideEmptyValuesbooleanHide empty values
showHintbooleanHint
legendLegend

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: DONUT_CHART
  apiVersion: "16"
  type: DONUT_CHART
  settings:
    displayCondition:
      mode: DISABLED
    textSize: 12
    ignoreFilters: false
    legend:
      width:
        value: 150
        mode: PIXEL
      position: RIGHT
      verticalAlign: TOP
    filters: []
    showHint: true
    filterMode: DEFAULT
    measures:
      - displayCondition:
          mode: DISABLED
        color:
          mode: AUTO
        dbDataType: INTEGER
        name: Sales count
        format: NUMBER
        value:
          mode: TEMPLATE
          templateName: countDistinct
          dbType: CH
          tableName: sale
          columnName: Sales count
        formatting: AUTO
        valueLabel:
          size: 12
          enabled: false
        showLabels:
          enabled: true
          absolute: false
          size: 12
    sorting:
      - name: Sales count
        value:
          mode: IN_WIDGET
          index: 0
          group: measures
        direction: DESC
      - name: sum("sale"."Sales amount")
        value:
          mode: FORMULA
          formula: sum("sale"."Sales amount")
        direction: DESC
    dimensionLimit: 4
    dimensions:
      - displayCondition:
          mode: DISABLED
        dbDataType: STRING
        name: Store type
        format: STRING
        value:
          mode: FORMULA
          formula: '"store"."Store type"'
        formatting: AUTO
        color:
          mode: DISABLED
        onClick: []
    title: ""
    titleSize: 14
    stateName: null
    titleColor:
      mode: AUTO
    titleWeight: NORMAL
    showMarkdown: false
    markdownMeasures: []
    markdownText: ""

Was the article helpful?

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