PieChart

Pie chart for displaying multiple values.

Symbol

P i e C h a r t

Menu ribbon

Start > Controls > Input/output > Variable output > PieChart

The "PieChart" control element displays variable values as segments of a ring. In order to visualise the respective share of a value in the total value of all values considered, the individual segments are displayed in different colours. In addition to the actual diagram, the PieChart can display a legend to describe the individual segments.

Example: The PieChart can be used, for example, to show how often certain alarms occur in comparison to the total frequency of all alarms or how long certain alarms are active in comparison to the total duration of all alarms.

P i e C h a r t

PieChart with three segments

Functionalities

The control element supports the following functionality:

You can configure these functionalities via the properties in the Properties window when you select the control in the Designer or in the document outline.

Style

There are no system styles available for the control. You can create your own styles for the control. These styles are available for selection in the "Style" property after creation.

Structure

Internally, the PieChart consists of two main elements: the "PieCore", which contains a graphic (SVG) that draws a ring of defined segments, and the "PieLegend", which represents the legend for the graphic.

P i e C h a r t A u f b a u

The PieChart and its elements

Ring diagram

The control element contains a graphic (SVG) that represents a ring. The PieChart can only be used effectively if at least two segments have been configured. In addition, the following can be configured for the ring diagram via properties in the "PieChart" category:

Segment (PieSegment)

To display variable values as segments in the ring, a "PieSegment" element must be added to the PieChart for each variable. The PieChart contains a PieSegment by default.

To add PieSegments or remove existing ones, open the Collection Editorvia the E l l i p s e button behind the "Segments" property.

The PieSegment supports the following functionality::

  • Connection to an analogue process variable(integer value/floating point value) for the data source. The value of the variable determines the length of the segment. The value is also displayed as a number in the NumericVarOut element within the legend.

  • Display of a language-switchable text for the labelling. The label is displayed in the NumericVarOut element within the legend.

  • Display of the unitin addition to the variable value. The unit is displayed in the NumericVarOut element within the legend.

The following can also be configured for the display of the element:

  • Color of the segment(FillColor)

  • Inner and outer radius of the segment(InnerRadius, OuterRadius)

    • These properties are empty by default. This means that the segments adopt the inner and outer radius of the ring by default.

Legend (PieLegend)

The legend (PieLegend) creates an entry for each new PieSegment(FlexLayout). This contains a ColorIndicator and a NumericVarOut. The colour configured in the "FillColor" property of a PieSegment is used both for the PieSegment and for the corresponding ColorIndicator. The labelling, the unit and the value of a PieSegment are also displayed in the corresponding NumericVarOut.

The "ShowLegend" property is used to specify whether the legend should be displayed. The following can also be configured for the legend via the properties of the "Legend" category:

LegendPosition

Defines the position of the legend and the ring diagram within the control element. The name for the setting (Left, Top, Right, Bottom) refers to the position of the legend relative to the ring diagram.

  • As the size of the ring diagram is set to 100 % by default (PieHeight, PieWidth), the settings of the "LegendPosition" and "LegendAlignment" properties only have a visible effect on the legend. If the height and width of the ring diagram are reduced (e.g. to 40 %), it becomes visible that the position and alignment of the ring diagram are influenced by these properties.

L e g e n d P o s i t i o n

Position of the legend (2) and the ring diagram (1) with LegendAlignment=Centre

LegendAlignment

Defines the alignment of the legend and the ring diagram. The property is perpendicular to the "LegendPosition" setting:

  • If "LegendPosition"="Left"/"Right", then the vertical alignment of the legend and the ring diagram is defined via "LegendAlignment" (Top, Bottom, Centre).

    L e g e n d A l i g n m e n t T o p B o t t o m C e n t e r

    Alignment of the ring diagram (1) and the legend (2) with LegendPosition=Right

  • If "LegendPosition"="Top"/"Bottom", then the horizontal alignment of the legend and the ring diagram is defined via "LegendAlignment" (Left, Right, Centre).

    L e g e n d A l i g n m e n t L e f t R i g h t C e n t e r

    Alignment of the ring diagram (1) and the legend (2) with LegendPosition=Bottom

Related topics: