Next / Previous / Contents / TCC Help System / NM Tech homepage

6.3. The canvas arc object

An arc object on a canvas, in its most general form, is a wedge-shaped slice taken out of an ellipse. This includes whole ellipses and circles as special cases. See Section 6.7, “The canvas oval object” for more on the geometry of the ellipse drawn.

To create an arc object on a canvas C, use:

    id = C.create_arc ( x0, y0, x1, y1, option, ... )

The constructor returns the object ID of the new arc object on canvas C.

Point (x0, y0) is the top left corner and (x1, y1) the lower right corner of a rectangle into which the ellipse is fit. If this rectangle is square, you get a circle.

The various options include:

extentWidth of the slice in degrees. The slice starts at the angle given by the start option and extends counterclockwise for extent degrees.
fillBy default, the interior of an arc is transparent, and fill="" will select this behavior. You can also set this option to any color and the interior of the arc will be filled with that color.
outlineThe color of the border around the outside of the slice. Default is black.
outlinestippleIf the outline option is used, this option specifies a bitmap used to stipple the border. Default is black, and that default can be specified by setting outlinestipple="".
startStarting angle for the slice, in degrees, measured from +x direction. If omitted, you get the entire ellipse.
stippleA bitmap indicating how the interior fill of the arc will be stippled. Default is stipple="" (solid). You'll probably want something like stipple="gray25". Has no effect unless fill has been set to some color.
styleThe default is to draw the whole arc; use style=PIESLICE for this style. To draw only the circular arc at the edge of the slice, use style=ARC. To draw the circular arc and the chord (a straight line connecting the endpoints of the arc), use style=CHORD.

widthWidth of the border around the outside of the arc. Default is 1 pixel.