PieChartLabelOptions

Modified in version 5.0

PieChartLabelOptions ( useRelativeLimits ;​ outerLabelOffset ;​ innerLabelOffset ;​ optimizeLabelTextColor )

Argument Type Range Default Note
useRelativeLimits int 0..1 off
outerLabelOffset num -100..100 0 In % of pie radius
innerLabelOffset num -100..100 0 In % of pie radius
optimizeLabelTextColor int 0..1 off xmCHART 5.0.5 or higher required
Examples
Description

The 1st argument useRelativeLimits makes it possible to define relative limits instead of absolute limits. Chart values, which do not lie within these limits, are not labeled. The limits, i.e. the lower and upper limit, are defined in the LabelOptions() function. By using the arguments outerLabelOffset and innerLabelOffset, the space between the border and the outer and inner labels can be controlled.
xmCHART 4+ comes with an additional flag for the 3rd argument innerLabelOffset: By attaching 1 to innerLabelOffset the offset is the distance between the border of the pie chart and the center of the inner label texts, in opposite to the distance between the border of the pie chart and the outer edge of the inner label texts (default).

PIE_CHART_LABEL_OPTIONS_01
1

OpenDrawing(280;​280)

2

OpenChart(20;​20;​240;​240;​on)

3

ChartData(100 80 40 30 10)

4

PieChart(shadow;​3;​50)

5

/* Set up styles. */

6

FillColorScheme(9)

7

PieChartLabelOptions(;​;​25 1)

8

PieChartInnerLabelTexts("Project 1\n[|u|]";​

9

"Project 2\n[|u|]";​

10

"Project 3\n[|u|]";​

11

"Project 4\n[|u|]";​

12

"Project 5\n[|u|]")

13

PieChartInnerLabelStyle(Verdana;​9;​bold;​white;​center)

14

BorderStyle(all;​none)

15

ShadowStyle(all;​2 2 3)

16

CloseChart()

17

CloseDrawing()

PIE_CHART_LABEL_OPTIONS_01

By activating the argument optimizeLabelTextColor =​ on the inner label text color is automatically adjusted to ensure good readability.

PIE_CHART_LABEL_OPTIONS_02
1

/* Regular inner label text color: BLACK (#333333) */

2

OpenDrawing(460;​220)

3

OpenChart(50;​50;​120;​120;​on)

4

ChartData(100 75 50 25)

5

PieChart(label+shadow)

6

PieChartLabelOptions(on;​5;​20;​off) /* Don't optimize label text color. */

7

PieChartInnerLabelTexts("|u|") /* Show absolute values. */

8

PieChartInnerLabelStyle(Verdana;​10;​plain;​#333333)

9

/* Set up styles. */

10

FillStyle(1;​#ffb400;​shaded)

11

FillStyle(2;​#f81a53;​shaded)

12

FillStyle(3;​#0055ee;​shaded)

13

FillStyle(4;​#00a79d;​shaded)

14

BorderStyle(all;​;​1.5;​white)

15

ShadowStyle(all;​2 2 3)

16

LabelTexts(1;​"|||f1|%") /* Show relative values. */

17

LabelStyle(1;​Verdana;​10;​plain;​#333333)

18

CloseChart()

19

OpenChart(280;​50;​120;​120;​on)

20

ChartData(100 75 50 25)

21

PieChart(label+shadow)

22

PieChartLabelOptions(on;​5;​20;​on) /* Optimize label text color. */

23

PieChartInnerLabelTexts("|u|") /* Show absolute values. */

24

PieChartInnerLabelStyle(Verdana;​10;​plain;​#333333)

25

/* Set up styles. */

26

FillStyle(1;​#ffb400;​shaded)

27

FillStyle(2;​#f81a53;​shaded)

28

FillStyle(3;​#0055ee;​shaded)

29

FillStyle(4;​#00a79d;​shaded)

30

BorderStyle(all;​;​1.5;​white)

31

ShadowStyle(all;​2 2 3)

32

LabelTexts(1;​"|||f1|%") /* Show relative values. */

33

LabelStyle(1;​Verdana;​10;​plain;​#333333)

34

CloseChart()

35

CloseDrawing()

PIE_CHART_LABEL_OPTIONS_02
PIE_CHART_LABEL_OPTIONS_03
1

/* Regular inner label text color: WHITE (#f5f5f5) */

2

OpenDrawing(460;​220)

3

OpenChart(50;​50;​120;​120;​on)

4

ChartData(100 75 50 25)

5

PieChart(label+shadow)

6

PieChartLabelOptions(on;​5;​20;​off) /* Don't optimize label text color. */

7

PieChartInnerLabelTexts("|u|") /* Show absolute values. */

8

PieChartInnerLabelStyle(Verdana;​10;​bold;​#f5f5f5)

9

/* Set up styles. */

10

FillStyle(1;​#ffb400;​shaded)

11

FillStyle(2;​#f81a53;​shaded)

12

FillStyle(3;​#0055ee;​shaded)

13

FillStyle(4;​#00a79d;​shaded)

14

BorderStyle(all;​;​1.5;​white)

15

ShadowStyle(all;​2 2 3)

16

LabelTexts(1;​"|||f1|%") /* Show relative values. */

17

LabelStyle(1;​Verdana;​10;​plain;​#333)

18

CloseChart()

19

OpenChart(280;​50;​120;​120;​on)

20

ChartData(100 75 50 25)

21

PieChart(label+shadow)

22

PieChartLabelOptions(on;​5;​20;​on) /* Optimize label text color. */

23

PieChartInnerLabelTexts("|u|") /* Show absolute values. */

24

PieChartInnerLabelStyle(Verdana;​10;​bold;​#f5f5f5)

25

/* Set up styles. */

26

FillStyle(1;​#ffb400;​shaded)

27

FillStyle(2;​#f81a53;​shaded)

28

FillStyle(3;​#0055ee;​shaded)

29

FillStyle(4;​#00a79d;​shaded)

30

BorderStyle(all;​;​1.5;​white)

31

ShadowStyle(all;​2 2 3)

32

LabelTexts(1;​"|||f1|%") /* Show relative values. */

33

LabelStyle(1;​Verdana;​10;​plain;​#333)

34

CloseChart()

35

CloseDrawing()

PIE_CHART_LABEL_OPTIONS_03

See also functions BarChartOptions() and GanttChartOptions() .

Scroll to Top