PieChart

PieChart ( appearanceConst ;​ pieDepth ;​ innerRadius ;​ startAngle ;​ arcAngle )

Argument Type Range Default Note
appearanceConst int 0..127 default
pieDepth num 0..200 0 In % of pie radius
innerRadius num 0..100 0 In % of pie radius
startAngle num -360..+360 0 Dimension:[deg]
arcAngle num -360..+360 360 Dimension:[deg]
Examples

PieChart(label+oval;​;​80)

PieChart(label;​20;​80;​-135;​270)

Description

The PieChart() function makes it possible to draw a variety of different pie charts.

PIE_CHART_01
1

OpenDrawing(160;​160)

2

ChartData(135 135 135)

3

PieChart()

4

/* Set up styles. */

5

FillStyle(1;​#ffb400)

6

FillStyle(2;​#f81a53)

7

FillStyle(3;​#0073dd)

8

BorderStyle(all;​none)

9

CloseDrawing()

PIE_CHART_01

Only the first data series in ChartData() is represented; other data series are ignored. The same goes for values less than or equal to zero.

PIE_CHART_02
1

OpenDrawing(160;​160)

2

ChartData(-100 135 135 0 135;​ /* Values less or equal 0 are skipped. */

3

100 200 300) /* 2nd series is ignored. */

4

PieChart()

5

/* Set up styles. */

6

FillStyle(1;​yellow;​shaded)

7

FillStyle(2;​blue;​shaded)

8

FillStyle(3;​red;​shaded)

9

FillStyle(4;​gray;​shaded)

10

FillStyle(5;​green;​shaded)

11

BorderStyle(all;​;​3;​white)

12

CloseDrawing()

PIE_CHART_02

The 1st argument appearanceConstants makes it possible to choose between an elliptical form (appearanceConstants = oval), i.e. the entire available area can be made use of, or a circular shape. As the default, all pie charts are drawn circular. In addition, shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) can be added to pie charts. All options can be combined by using a plus sign "+".

PIE_CHART_03
1

OpenDrawing(250;​160)

2

ChartData(28 15 10 9 8 4)

3

PieChart(oval+label)

4

/* Set up styles. */

5

FillColorScheme(blue;​shaded)

6

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

7

CloseDrawing()

PIE_CHART_03

The fills, borders and shadows can be varied by using the style functions FillColorScheme() , FillStyle() , PictureStyle() , BorderColorScheme() , BorderStyle() and ShadowStyle() and the labels by using the five style functions LabelTexts() , LabelStyle() , LabelBackground() , LabelBackgroundOptions() and LabelOptions() . The 2nd argument pieDepth makes it possible to draw three-dimensional pie charts. The pie depth should be entered in percent of the segment length (= pie chart radius).

PIE_CHART_04
1

OpenDrawing(160;​160)

2

ChartData(135 135 135)

3

PieChart(shadow;​6)

4

/* Set up styles. */

5

FillStyle(1;​#ffb400;​shaded)

6

FillStyle(2;​#f81a53;​shaded)

7

FillStyle(3;​#0073dd;​shaded)

8

BorderStyle(all;​none)

9

ShadowStyle(all;​2 2 3)

10

CloseDrawing()

PIE_CHART_04
PIE_CHART_05
1

OpenDrawing(250;​160)

2

ChartData(135 135 135)

3

PieChart(label+oval+shadow;​8;​50)

4

/* Set up styles. */

5

FillStyle(1;​#ffb400;​shaded)

6

FillStyle(2;​#f81a53;​shaded)

7

FillStyle(3;​#0073dd;​shaded)

8

BorderStyle(all;​none)

9

ShadowStyle(all;​2 2 3)

10

CloseDrawing()

PIE_CHART_05

The 3rd argument innerRadius serves to draw ring charts. The inner radius should be entered in percent of the segment length (= pie chart radius).

PIE_CHART_06
1

OpenDrawing(200;​200)

2

OpenChart(40;​40;​120;​120;​on)

3

ChartData(135 135 135)

4

PieChart(label+shadow;​;​50)

5

/* Set up styles. */

6

FillStyle(1;​#ffb400;​shaded)

7

FillStyle(2;​#f81a53;​shaded)

8

FillStyle(3;​#0073dd;​shaded)

9

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

10

ShadowStyle(all;​2 2 3)

11

CloseChart()

12

CloseDrawing()

PIE_CHART_06

As the default, the segments of a pie chart are arranged clockwise over 360° (full circle), starting at the top (12 o'clock). By using the arguments startAngle and arcAngle, the position of the first segment as well as the direction and range (arc angle) of the pie chart can be defined. By defining a start angle greater than zero all segments are moved clockwise; by entering a negative start angle they are moved counter-clockwise. All angles are to be entered within the range of ±360 degrees. A start angle of 0 degrees is at the top (12 o'clock), of 90 degrees is on the right (3 o'clock) and of -90 degrees is on the left (9 o'clock).

PIE_CHART_07
1

OpenDrawing(160;​160)

2

ChartData(100 100 100)

3

PieChart(label+shadow;​;​;​-60)

4

/* Set up styles. */

5

FillStyle(1;​#ffb400;​shaded)

6

FillStyle(2;​#f81a53;​shaded)

7

FillStyle(3;​#0073dd;​shaded)

8

BorderStyle(all;​none)

9

ShadowStyle(all;​2 2 3)

10

CloseDrawing()

PIE_CHART_07

With an arc angle unequal to ±360 degrees the segments are arranged in the form of a sector. A negative arc angle causes the segments to be arranged counter-clockwise.

PIE_CHART_08
1

OpenDrawing(160;​160)

2

ChartData(100 100 100)

3

PieChart(label+shadow;​;​;​-90;​180)

4

/* Set up styles. */

5

FillStyle(1;​#ffb400;​shaded)

6

FillStyle(2;​#f81a53;​shaded)

7

FillStyle(3;​#0073dd;​shaded)

8

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

9

ShadowStyle(all;​2 2 3)

10

CloseDrawing()

PIE_CHART_08
PIE_CHART_09
1

OpenDrawing(200;​180)

2

OpenChart(40;​40;​120;​120;​on)

3

ChartData(100 100 100)

4

PieChart(label+shadow;​;​50;​135;​-270)

5

/* Set up styles. */

6

FillStyle(1;​#ffb400;​shaded)

7

FillStyle(2;​#f81a53;​shaded)

8

FillStyle(3;​#0073dd;​shaded)

9

BorderStyle(all;​none)

10

ShadowStyle(all;​2 2 3)

11

CloseChart()

12

CloseDrawing()

PIE_CHART_09
Scroll to Top