Navigation: Language Reference > 13 - Built-in Functions >====== PIE (draw a pie chart) ====== | |
PIE( x ,y ,width ,height ,slices ,colors [,depth] [,wholevalue] [,startangle] [,attributelist])
PIE | Draws a pie chart on the current window or report. |
X | An integer expression that specifies the horizontal position of the starting point. |
Y | An integer expression that specifies the vertical position of the starting point. |
Width | An integer expression that specifies the width. |
Height | An integer expression that specifies the height. |
Slices | A SIGNED array of values that specify the relative size of each slice of the pie. |
Colors | A LONG array that specifies the fill color for each slice. |
Depth | An integer expression that specifies the depth of the three-dimensional pie chart. If omitted, the chart is two-dimensional. |
wholevalue | A numeric constant or variable that specifies the total value required to create a complete pie chart. If omitted, the sum of the slices array is used. |
startangle | A numeric constant or variable that specifies the starting point of the first slice of the pie, measured as a fraction of the wholevalue. If omitted (or zero), the first slice starts at the twelve o'clock position. |
attributelist | A string constant, variable, or EQUATE containing an optional type of output document and its associated attributes. Only valid when the target is a REPORT. See EXTEND |
The PIE procedure creates a pie chart on the current window or report. This procedure is valid in Clarion Win32 Windows, and also for REPORT structures in both Clarion Win32 and Clarion#.
The pie (an ellipse) is drawn inside a “bounding box” defined by the x, y, width, and height parameters. The x and y parameters specify the starting point, and the width and height parameters specify the horizontal and vertical size of the “bounding box.”
The slices of the pie are created clockwise from the startangle parameter as a fraction of the wholevalue. Supplying a wholevalue parameter that is greater than the sum of all the slices array elements creates a pie chart with a piece missing.
The color of the lines is the current pen color set by SETPENCOLOR; the default color is the Windows system color for window text. The width of the lines is the current width set by SETPENWIDTH; the default width is one pixel. The line style is the current pen style set by SETPENSTYLE; the default style is a solid line.
Example:
PROGRAM
MAP
END
Window WINDOW('Child One'),AT(0,0,320,200),HVSCROLL,SYSTEM,MAX
END
SliceSize SIGNED,DIM(4)
SliceColor LONG,DIM(4)
CODE
SliceSize[1] = 90
SliceColor[1] = 0 !Black
SliceSize[2] = 90
SliceColor[2] = 00FF0000h !Red
SliceSize[3] = 90
SliceColor[3] = 0000FF00h !Green
SliceSize[4] = 90
SliceColor[4] = 000000FFh !Blue
OPEN(Window)
PIE(100,50,100,50,SliceSize,SliceColor,20)
!Draw pie chart containing
!four equal slices, starting at 12 o'clock
!drawn counter-clockwise - Black, Red, Green, and Blue
ACCEPT
END
See Also: