PIE

Concept Link IconSee alsoConcept Link IconExample

Manage the operation of a Pie Control in the HMI.

WebVue support - No. Returns an unsuccessful code if used in this context.

Mode Mnemonic Syntax
1 ADD_DATAPOINT 1
2 REMOVE_POINT, REMOVE_DATAPOINT* 2
3 CLEAR 3
4 GET_COUNT 3
5 SET_COLOR 4
6 SET_VALUE 5
7 LOAD 6
8 COLLECTED_LABEL 7
9 COLLECTED_COLOR 8
10 COLLECTED_THRESH 9
11 RESET_COLLECTED 3
12 EXPLODED_SLICE 10
13 RESET_EXPLODED 3
14 PRINT 11
15 COPY_CLIPBOARD 3
16 SAVE_IMAGE 12
17 SET_CHARTTYPE 13
18 SET_3DDISPLAY 14
19 CUSTOM_PROPERTY 15
20 SET_TITLE 16
21 SHOW_LEGEND 17
22 SET_BACKIMAGE 18
23 ADD_VARPOINT 19
24 INSERT_VARPOINT 20
25 INSERT_DATAPOINT 21
26 GET_ITEMTYPE 2
27 SET_VARIABLE 22
28 SET_LEGEND 23
29 SET_TEXT 24
30 SET_TEXTSOURCE 25
31 SET_LEGENDSOURCE 26
32 SET_REFRESHMODE 27
33 SET_REFRESHPERIOD 28
34 SAVE 6

* Mode REMOVE_DATAPOINT is deprecated and has been replaced by REMOVE_POINT. REMOVE_DATAPOINT is still supported at run-time for backwards compatibility.

Modes 8 to 13 inclusive are used, for a pie or doughnut chart, to manage the collection one or more segments into one. They cannot be used with a pyramid chart.

Properties common to more than one mode

Argument

Meaning

Window The name of the window containing the pie. Type STR.
Branch The branch of the window containing the pie. Type STR.
Identifier The identifier of the pie (within the window). Type STR.
Tooltip The text for a tooltip that appears when the mouse is over a segment. Type STR.
Value The value for a segment. Type DOUBLE.
Label The text for the label. Type STR
LegendText The text for the legend. Type STR
Variable The name of a variable. Type STR
Index Position within the collection of pie segments. Type INT

Syntax 1

LongVal = PIE(Mode, Window, Branch, Identity, Value, Label, LegendText [, Tooltip])

Return type: LONG.

Execution

Mode

Mnemonic

Action

1 ADD_DATAPOINT

Add a data point to the end of the collection.
Return: 1 if OK, else 0.

Syntax 2

LongVal = PIE(Mode, Window, Branch, Identity, Index)

Return type: LONG.

Execution

Mode

Mnemonic

Action

2 REMOVE_DATAPOINT*

Remove a data point from the collection using the given index.

Return: The number of data points after the remove, or 0 if unsuccessful.

2 REMOVE_POINT

Remove a point from the collection using the given index.

Return: The number of points after the remove, or 0 if unsuccessful.

26 GET_ITEMTYPE Get the type of the item at the specified index.
Return: 1 if a value, 2 if a variable name.

* Mode REMOVE_DATAPOINT is deprecated and has been replaced by REMOVE_POINT. REMOVE_DATAPOINT is still supported at run-time for backwards compatibility.

Syntax 3

LongVal = PIE(Mode, Window, Branch, Identity)

Return type: LONG.

Execution

Mode

Mnemonic

Action

3 CLEAR

Clear the entire data point collection.

Return: 1 if OK, else 0.

4 GET_COUNT Return: The number of data points in the collection, or 0 if unsuccessful.
11 RESET_COLLECTED Reset a collected slice to its component slices.
Return: 1 if OK, else 0.
13 RESET_EXPLODED Reset all exploded slices.
Return: 1 if OK, else 0.
15 COPY_CLIPBOARD Copy an image representing the chart to the clipboard.
Return: 1 if OK, else 0.

Syntax 4

LongVal = PIE(Mode, Window, Branch, Identity, Index, Red, Green, Blue[, Opacity]);

Return type: LONG.

Argument

Meaning

Red,Green,Blue

An RGB color as three integers. Type INTEGER.

Opacity

The opacity used for alpha blending. Range 0 to 100%. Type INTEGER.

Execution

Mode

Mnemonic

Action

5 SET_COLOR

Set the color, and optional opacity, for the segment at the given index.

Return: 1 if OK, else 0.

Syntax 5

LongVal =PIE(Mode, Window, Branch, Identity, Index, Value);

Return type: LONG.

Execution

Mode

Mnemonic

Action

6 SET_VALUE

Set the data point value for the segment at the given index

Return: 1 if OK, else 0.

Syntax 6

LongVal = PIE(Mode, Window, Branch, Identity, FilePath);

Return type: LONG.

Argument

Meaning

FilePath

Either the full path name of a file, or just the file name itself if located in the project's TP folder. Type STR.

Execution

Mode

Mnemonic

Action

7 LOAD

Load a pie chart contents from a file.

Return: 1 if OK, else 0.

34 SAVE

Save a pie chart contents in a file. The pie chart's source must be set to File or the instruction will fail.

Return: 1 if successful (contents saved in file), else 0.

Syntax 7

LongVal = PIE(Mode, Window, Branch, Identity, Label[, LegendText][, Tooltip]);

Return type: LONG.

Execution

Mode

Mnemonic

Action

8 COLLECTED_LABEL

Specifies the texts of the label, legend and tooltip of the collected slice.

If the ToolTip argument is not set, then the tooltip will be the same as label text.

Return: 1 if OK, else 0.

Syntax 8

IntVal = PIE(Mode, Window, Branch, Identity, Red, Green, Blue[, Opacity]);

Return type: LONG.

Argument

Meaning

Red,Green,Blue

An RGB color as three integers. Type INTEGER.

Opacity

The opacity used for alpha blending. Range 0 to 100%. Type INTEGER.

Execution

Mode

Mnemonic

Action

9 COLLECTED_COLOR

Sets the color and the opacity of the collected slice.

Return: 1 if OK, else 0.

Syntax 9

LongVal = PIE(Mode, Window, Branch, Identity, ThresholdValue[, UsePercent]);

Return type: LONG.

Argument

Meaning

ThresholdValue

The threshold value under which segments are grouped. Type LONG.

UsePercent A flag, either 0 or 1. Type INTEGER.

Execution

Mode

Mnemonic

Action

10 COLLECTED_THRESH

Specifies the threshold value under which the slices will be grouped.
If UserPercent = 1 then ThesholdValue is a percent and must be between 0 and 100.
If UserPercent = 0 then ThesholdValue is an absolute value and can be any positive value.

Return: 1 if OK, else 0.

Syntax 10

LongVal = PIE(Mode, Window, Branch, Identity, Index[, Exploded])

Return type: LONG.

Argument

Meaning

Exploded

The sub-mode. Type INTEGER.
1 = the slice at the given Index is exploded.

0 = then the slice at the given Index is no longer exploded.

-1 = the collected slice is exploded.

Execution

Mode

Mnemonic

Action

12 EXPLODED_SLICE

Manage exploded segments.

Return: 1 if OK, else 0.

Syntax 11

LongVal = PIE(Mode, Window, Branch, Identity[, Orientation][, Printer])

Return type: LONG.

Argument

Meaning

Orientation

The orientation for the print. Type INTEGER.

1 = landscape.
2 = portrait.

Printer The printer name. Type STR.

Execution

Mode

Mnemonic

Action

14 PRINT

Print the chart on the selected printer. If the printer name is omitted, the Windows' default printer is used.

Return: 1 if OK, else 0.

Syntax 12

LongVal = PIE(Mode, Window, Branch, Identity, ImageFile[, ImageFormat])

Return type: LONG.

Argument

Meaning

ImageFile

Either the full path name of a file, or just the file name itself if located in the project's TP folder. Type STR.

ImageFormat

The image format. Type INTEGER.
0 = Bmp (default)

1 = Gif

2 = Png

Execution

Mode

Mnemonic

Action

16 SAVE_IMAGE

Save a copy of the chart as an image in the specified format.

Return: 1 if OK, else 0.

Syntax 13

LongVal = PIE(Mode, Window, Branch, Identity, ChartType[, Radius])

Return type: LONG.

Argument

Meaning

ChartType

The chart type. Type INTEGER.
0 = Pie / Doughnut
1 = Pyramid

Radius

The inner radius of the doughnut. Default 0. Type INTEGER.

Execution

Mode

Mnemonic

Action

17 SET_CHARTTYPE

Set the appearance of the chart from either pie, doughnut or pyramid.

Return: 1 if OK, else 0.

Syntax 14

LongVal = PIE(Mode, Window, Branch, Identity, 3dDisplay)

Return type: LONG.

Argument

Meaning

3dDisplay

A flag indicating the display mode. Type INTEGER.
0 = 2D.
1 = 3D.

Execution

Mode

Mnemonic

Action

18 SET_3DDISPLAY

Set the appearance of the chart from either 2D or 3D.

Return: 1 if OK, else 0.

Syntax 15

LongVal = PIE(Mode, Window, Branch, Identity, Property, PropertyValue)

Return type: LONG.

Argument

Meaning

Property

The name of the property to modify. See the table below for the possible values. Type STR.

PropertyValue The new value for the property. See the table below for the possible values. Type INTEGER.

Name

Value

Palette

0 = Custom

1 to 12 = Standard palette

LabelPosition

0 = Inside

1 = Outside

2 = Disabled

3 = Outside in column (Pyramid)

LabelFormat

0 = Text and value

1 = Text and value percent

2 = Text

3 = Value

4 = Value percent

LegendFormat

0 = Text and value

1 = Text and value percent

2 = Text

3 = Value

4 = Value percent

Pie_2dStyle

2d only.

0 = Default

1 = Convex

2 = Concave

Pie_Radius 0 to 99
Pie_Angle 0 to 360
Pyr_ValueType

0 = Linear value type

1 = Surface value type

Pyr_3dBase

3d only

0 = Square base

1 = Circular base

Pyr_3dAngle

3d only

-10 to 10

Pyr_Gap 0 to 100
Pyr_Label_InsidePos

0 = Center

1 = Top

2 = Bottom

Pyr_Label_OutsidePos

0 - Right

1 - Left

Execution

Mode

Mnemonic

Action

19 CUSTOM_PROPERTY

Change the chart appearance using a set of properties and values. The properties prefixed Pie are applicable to the pie / doughnut chart type and the ones prefixed Pyr are applicable to the pyramid.

Return: 1 if OK, else 0.

Syntax 16

LongVal = PIE(Mode, Window, Branch, Identity, Title)

Return type: LONG.

Argument

Meaning

Title

The title for the chart. Type STR.

Execution

Mode

Mnemonic

Action

20 SET_TITLE

Set the chart main title.

Return: 1 if OK, else 0.

Syntax 17

LongVal = PIE(Mode, Window, Branch, Identity, Show)

Return type: LONG.

Argument

Meaning

Show

A flag. Type INTEGER.
0 = Hide the legend. Default setting.
1 = Show the legend.

Execution

Mode

Mnemonic

Action

21 SHOW_LEGEND

Show or hide the chart legend.

Return: 1 if OK, else 0.

Syntax 18

LongVal = PIE(Mode, Window, Branch, Identity, Path[, Area[, WrapMode[, Position]]])

Return type: LONG.

Argument

Meaning

Path

Full path of an image file. Type STR.

Area

The position of the image. Type INTEGER
0 = Plot area

1 = Legend area

2 = Border area

3 = Entire chart area

WrapMode

How the image is displayed. Type INTEGER
0 = Image is scaled. This is the default.

1 = Image is tiled
2 = Actual size

Position

Position of the image when displayed as actual size.
0 = Center

1 = Left

2 = Right

3 = Bottom

4 = Bottom left
5 = Bottom right
6 = Top
7 = Top left
8 = Top right

Execution

Mode

Mnemonic

Action

22 SET_BACKIMAGE

Display an image as the chart background.

Return: 1 if OK, else 0.

Syntax 19

LongVal = PIE(Mode, Window, Branch, Identity, Variable, Label, LegendText[, Tooltip])

Return type: LONG.

Execution

Mode

Mnemonic

Action

23 ADD_VARPOINT

Add a variable item (variable name) to the end of the collection.

Return: 1 if OK, else 0.

Syntax 20

LongVal = PIE(Mode, Window, Branch, Identity, Index, Variable, Label, LegendText[, Tooltip])

Return type: LONG.

Execution

Mode

Mnemonic

Action

24 INSERT_VARPOINT

Insert a variable item (variable name) at the specified index.

Return: 1 if OK, else 0.

Syntax 21

LongVal = PIE(Mode, Window, Branch, Identity, Index, Value, Label, LegendText[, Tooltip])

Return type: LONG.

Execution

Mode

Mnemonic

Action

25 INSERT_DATAPOINT

Insert a data item at the specified index.

Return: 1 if OK, else 0.

Syntax 22

LongVal = PIE(Mode, Window, Branch, Identity, Index, Variable)

Return type: LONG.

Execution

Mode

Mnemonic

Action

27 SET_VARIABLE

Set the variable name for the given index. Only possible on items of type variable.

Return: 1 if OK, else 0.

Syntax 23

LongVal = PIE(Mode, Window, Branch, Identity, Index, LegendText)

Return type: LONG.

Execution

Mode

Mnemonic

Action

28 SET_LEGEND

Set the legend text at the given index.

Return: 1 if OK, else 0.

Syntax 24

LongVal = PIE(Mode, Window, Branch, Identity, Index, Label)

Return type: LONG.

Execution

Mode

Mnemonic

Action

29 SET_TEXT

Set the label text at the given index.

Return: 1 if OK, else 0.

Syntax 25

LongVal = PIE(Mode, Window, Branch, Identity, Index, SourceType)

Return type: LONG.

Argument

Meaning

SourceType

The source of the text. Type INTEGER
0 = None

1 = Variable name

2 = Variable description

Execution

Mode

Mnemonic

Action

30 SET_TEXTSOURCE

Set the source type for variable item's text at the given index.

Return: 1 if OK, else 0.

Syntax 26

LongVal = PIE(Mode, Window, Branch, Identity, Index, SourceType)

Return type: LONG.

Argument

Meaning

SourceType

The source of the legend. Type INTEGER
0 = None

1 = Variable name

2 = Variable description

Execution

Mode

Mnemonic

Action

31 SET_LEGENDSOURCE

Set the source type for variable item's legend at the given index.

Return: 1 if OK, else 0.

Syntax 27

LongVal = PIE(Mode, Window, Branch, Identity, Index, RefreshMode)

Return type: LONG.

Argument

Meaning

RefreshMode

The refresh mode for variable items. Type INTEGER
0 = Refresh periodically

1 = Refresh on variable value change

Execution

Mode

Mnemonic

Action

32 SET_REFRESHMODE

Set the refresh mode for variable items.

Return: 1 if OK, else 0.

Syntax 28

LongVal = PIE(Mode, Window, Branch, Identity, Index, RefreshPeriod)

Return type: LONG.

Argument

Meaning

RefreshPeriod

The refresh period. Range 2 to 3600 (in seconds). Type INTEGER

Execution

Mode

Mnemonic

Action

33 SET_REFRESHPERIOD

Set the refresh period for items of type variable items.

Return: 1 if OK, else 0.