7.5

Table Of Contents
Example
&maxwidth := pdfwidth( ‘parts_manual’,3 )
&maxheight := pdfheight( ‘parts_manual’,4 )
Pie (procedure)
Creates a pie slice shape, which can then be rendered using stroke, fill, or strokeandfill.
Syntax
pie( x, y, radius, startangle, endangle )
Arguments
x, y
Measure values representing the horizontal/vertical position, in inches, of a circle's center representing the whole pie from
which to draw a slice.
radius
Measure value representing the length, in inches, of the segments of the pie, i.e. its radius.
startangle, endangle
Measure values representing the angles, in degrees, of both segments of the pie slice. Values increase counter clock wise,
with 0 extending right from the center of the circle.
Code Sample Example
This example draws a whole pie chart with a shadow effect.
Example
setfillcolor([0,0,0,50]) %Set shadow colour to gray
pie(1.5,1.5,1,60,290) %Create shadow for first slice
translate(0.2,0.2) %Separate shadows
pie(1.5,1.5,1,290,420) %Create shadow for second slice
fill() %Display shadows
translate(-0.3, 0.3) %Offset chart from its shadow
setstrokecolor([0,0,100,0]) %Set pen colour to yellow
setfillcolor([0,100,100,0]) %Set fill colour to red
pie(1.5,1.5,1,60,290) %Create first slice
strokeandfill() %Draw first slice
©2010 Objectif Lune Inc - 313 -