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 a measure, you can additionally enable the display of the absolute value. For a dimension, you can enable array nesting, hide empty values, assign 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.

Type

You can configure the chart’s display type: doughnut (with a hollow center) or pie (full circle). The screenshot below shows an example of a full-circle (pie) chart.

Pie chart

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 in the view 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
titleWeightenumTitle font 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
chartTypeenumChart type:
- PIE — pie chart (full circle)
- DONUT — doughnut chart (with a hollow center)

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: donut-chart
    apiVersion: "17"
    type: DONUT_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
      dimensions:
        - name: Continent
          value:
            mode: FORMULA
            formula: '"store"."Continent"'
          dbDataType: String
          hideEmptyValues: false
          format:
            value: STRING
            mode: BASE
          formatting:
            value: AUTO
            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
            absolute: false
            size: 12
          displayCondition:
            mode: DISABLED
          color:
            mode: AUTO
      chartType: PIE
      legend:
        position: RIGHT
        verticalAlign: TOP
        width:
          value: null
          mode: PIXEL
      dimensionLimit: 10
      filters: []

Was the article helpful?

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