Skip to main content

Visualization Element: Donut Chart

Symbol:

_visu_icon_donut_chart.png

Category: Measurement Controls

A donut chart (ring chart) is a display element. It shows how a whole is composed of percentual parts. It is a special type of pie chart in which the center remains empty. The empty area in the middle can be used to display additional information and to display text.

Element properties

Are all element properties available?

All properties are available only after you select the Advanced option or the All categories filter in Properties.

Element name

GenElemInst_1

Name assignment

Assign individual names for elements so that they are found faster in the element list.

Type of element

Donut Chart

Position

The position defines the location and size of the element in the visualization window. This is based on the Cartesian coordinate system. The origin is located in the upper left corner of the window. The positive horizontal X-axis runs to the right. The positive vertical Y-axis runs downwards.

X

The X-coordinate (in pixels) of the upper left corner of the element

Example: 10

Y

The Y-coordinate (in pixels) of the upper left corner of the element

Example: 10

Width

Specified in pixels

Example: 150

Height

Specified in pixels

Example: 30

Tip

You can change the values by dragging the box _visu_icon_position_element.png symbols to other positions in the editor.

Data array

Data array

Data (array variable ARRAY[..]) which is visualized with this element

A one-dimensional array with a numeric base type is expected. All arrays used in this element must have the same dimension.

Example: PLC_PRG.arrInt

When executed, the array data is displayed as a donut chart.

PROGRAM PLC_PRG
VAR
	arrInt : ARRAY[0..3] OF INT := [45, 12, 58, 32];
END_VAR

Colors and labels

Text list

Text list for the chart; used for the labels in the legend.

_cds_icon_arrow_down.png: List box with the entries of all text lists defined in the project

Example: 'Textlist_1'

Segments

Static configuration of the segments of the donut chart

Clicking the _visu_icon_create_new.png Create New button will add an additional segment below.

[<Index>]

Configuration for the respective indexed segment

Color

Color of the segment

  • _cds_icon_arrow_down.png

    List box with style colors

    Example: Yellow

  • _cds_icon_three_dots.png

    The Color dialog opens. Here you can specify a color in detail.

Text ID

References a text from the text list for the labels in the legend

  • <text list>.<ID>

  • Double-clicking in the value field will open the line editor. Clicking the _cds_icon_three_dots.png symbol on the right side will provide help when entering text from a text list.

Dynamic configuration

Important

All arrays used should have the same dimensions.

Array for labels

Variable of type ARRAY OF STRING or ARRAY OF WSTRING for dynamic labels

Example: PLC_PRG.arrWstring

To display the texts that change at runtime, a variable can be passed which programmatically contains the current texts for the respective segment.

Double-clicking in the value field will open the line editor. Clicking the _visu_icon_input_assistant.png symbol will provide help with the input.

Array for colors

Variable of type ARRAY OF DWORD for dynamic colors

Example: PLC_PRG.arrDword

To display the colors that change at runtime, a variable can be passed which programmatically contains the current colors for the respective segment.

Double-clicking in the value field will open the line editor. Clicking the _visu_icon_input_assistant.png symbol will provide help with the input.

Array for visibility of segments

Variable of type ARRAY OF BOOL for the dynamic visibility of segments.

Example: PLC_PRG.arrBool

To display the visibility that changes at runtime, a variable can be passed which programmatically contains the current flag for the respective segment.

Double-clicking in the value field will open the line editor. Clicking the _visu_icon_input_assistant.png symbol will provide help with the input.

Property

Donut thickness

Fixed value for the thickness of the donut chart (in pixels)

Example: 40

Show tooltip

standard icon: As soon as a visualization user moves the mouse cursor over the element, a tooltip will be displayed.

Note

This is possible only when the overlay functionality is used.

For more information, see the following: Settings

Display values in percent

standard icon: The values are displayed as percentages.

Legend

Show legend

standard icon: The donut chart is displayed with a legend.

Legend position

The legend can be placed above or below the donut.

  • Top

  • Bottom

Value Format

Sets the format for the legend. The format specification must be compatible with the base data type of the data array.

Example: %5.2f

Font

Font for text output on the legend

  • _cds_icon_arrow_down.png

    List box with style fonts

    Example: Small Headline

  • _cds_icon_three_dots.png

    The Font dialog opens. Here you can specify a font in detail.

Font color

Color for text output of the legend

  • _cds_icon_arrow_down.png

    List box with style colors

    Example: Gray

  • _cds_icon_three_dots.png

    The Color dialog opens. Here you can specify a color in detail.

Center

The properties contain fixed values for the coordinates of the point of rotation. The rotation point is displayed in the editor as the _visu_icon_center_point.png symbol and is used as the center for rotation and scaling.

Tip

You can also change the values by dragging the _visu_icon_center_point.png symbol to another position in the editor.

X

Editable X-coordinate of the point of rotation

Double-clicking in the value field will open the line editor.

Y

Editable Y-coordinate of the point of rotation

Double-clicking in the value field will open the line editor.

Absolute movement

The properties contain IEC variables for controlling the position of the element dynamically. The reference point is the upper left corner of the element. At runtime, the entire element is moved.

Movement

X

Increasing this value at runtime moves the element to the right.

Y

Increasing this value at runtime moves the element downwards.

Rotation

Variable (numeric data type) for the angle of rotation (in degrees)

Example: PLC_PRG.iAngle1.

The midpoint of the element rotates at the Center point. This rotation point is shown as the _visu_icon_center_point.png symbol.

At runtime, the alignment of the element remains the same with respect to the coordinate system of the visualization. Increasing the value rotates the element to the right.

_visu_img_prp_rotation.png

Scaling

Variable (integer data type) to trigger a centric stretching

Example: PLC_PRG.iScaling

The reference point is the Center property.

The value 1 shrinks the element by a factor of 0.001. The value 1000 returns the element to its original size.

Interior rotation

Variable (numeric data type) for the angle of rotation (in degrees)

Example: PLC_PRG.iAngle2.

At runtime, the element rotates about the point of rotation specified in Center according to the value of the variable. In addition, the alignment of the element rotates according to the coordinate system of the visualization. Increasing the value in the code rotates clockwise.

The rotation point is shown as the _visu_icon_center_point.png symbol.

Note

If a static angle of rotation is specified in the Position → Angle property, then the static angle of rotation is added to the variable angle of rotation (offset) when the visualization is executed.

_visu_img_prp_inner_rotation.png

Tip

You can combine the variables to a Unit conversion.

Tip

The X, Y, Rotation, and Interior rotation properties are supported by the "Client Animation" functionality.

State variables

The variables control the element behavior dynamically.

Invisible

Variable (BOOL) for toggling the visibility of the element

TRUE: The element is not visible at runtime.

Tip

The Invisible property is supported by the "Client Animation" functionality.

Animation

Tip

These properties are available only when you have selected the Support client animations and overlay of native elements option in the Visualization Manager.

Animation duration

Variable for the duration (in milliseconds) in which the element runs an animation

  • Variable (integer value)

    Example: Menu.tContent with VAR tContent : INT := 500; END_VAR

  • Integer literal

    Example: 500

. Animatable properties
  • Absolute movement, Movement, X, Y

  • Absolute movement, Rotation

  • Absolute movement, Interior rotation

  • Absolute movement, Exterior rotation

The animated movement is executed when at least one value of an animatable property has changed. The movement then executed is not jerky, but is smooth within the specified animation duration. The visualization element travels to the specified position while rotating dynamically. The transitions are smooth.

Move to foreground

Variable (BOOL) for setting the element in the foreground

TRUE: At runtime, the visualization element is displayed in the foreground.

FALSE: At runtime, the visualization element is displayed in the layer where it was inserted in the visualization editor.

Example: bIsInForeground with VAR bIsInForeground : BOOL := FALSE; END_VAR

Permissions

Note

Available only when a user management is set up for visualization.

Access Rights button

Opens the Access Rights dialog. There you can edit the access privileges for the element.

. Status messages:
  • Not set. Full rights.: Access rights for all user groups : operable

  • Rights are set: Limited rights: Access is restricted for at least one group.