Last Updated: 3/4/97
Class NFPiechartApp

Class NFPiechartApp

public class NFPiechartApp extends Applet

This class supports the generation of piecharts that are defined by <applet> parameters in an HTML file. The user can rotate the pie and labels by dragging the mouse around the center.

The following standard parameters are supported by this chart:

 	Background

 	Header
 	HeaderBox
 	Footer
 	FooterBox
 	LeftTitle
 	LeftTitleBox
 	RightTitle
 	RightTitleBox

 	DwellLabel
 	DwellBox
 	ActiveClicks
 	ActiveLabels[1-50]

 	Legend
 	LegendBox
 	LegendItems

 	ColorTable

 	NoteSets
 	NoteSets[1-20]
 	NoteArrow
 	NoteAxis
 	NoteLabel
 	NoteBox

The following parameters are specifically supported by this chart:

Slices = (Slice Tuple1), (Slice Tuple2), ...;

 	Defines a set of slices for the piechart.  Each slice
 	is defined using a tuple containing the following
 	parameters:

 	Value		- numeric value represented by
 			  the pie slice.  The percentage
 			  will be computed based on the
 			  total of all slice values.
 	pieColor	- color of pie slice
 	"Label"		- label associated with pie slice.
 	labelColor	- label color
 	"labelFont"	- label font name
 	labelSize	- label font size
 	labelAngle	- label angle of rotation
 	bgColor		- color of underlying label region
 	bgBorder	- border type of underlying region

 	Only the first two values need to be specified, all others
 	will be assigned default values.  For the first slice,
 	the defaults will be based on system defaults.  For all
 	other slices, the value assigned to the previous slice
 	for that attribute will be used as the default.  In that
 	way, you need only specify attributes for the first slice
 	in order to control the attributes of all slices.  The
 	value "null" may be passed as a pie slice value, but has the
 	same effect as a 0 slice value.

 	If a pieColor is not specified in the vector, then the
 	previously specified color will be used. If the color is
 	specified as "null", then a default color will be chosen
 	from the color table. (See the ColorTable parameter.)

LabelPos = Float;

 	Defines the position of a pie slice label relative to
 	the width of the pie.  A value of 1.1 will place each
 	label just outside the pie, while a value of 0.6 will
 	place each label inside of each pie slice.

Pie3DDepth = Integer;

 	Specifies the pixel depth of the 3D effect or shadow.

The following HTML segment displays a piechart with 5 slices, with all slice label attributes the same:

 	<applet code=NFPiechartApp.class width=400 height=400>
 	<param	name=NFParamScript value='

 	Background = (lightBlue, RAISED, 5);

 	Header	   = ("Piechart Demo", darkRed, "TimesRoman", 32);
 	HeaderBox  = (lightGray, RAISED, 5);

 	LabelPos   = 1.1;

 	Slices	   = (27.7, darkRed,    "Mon", white),
 		     (34.5, lightGreen, "Tues"),
 		     (45,   darkBlue,   "Wed"),
 		     (12.0, pink),
 		     (36,   lightGray,  "Fri");
 	'>
 	</applet>

Instance Variables

Type Name Description Default
NFPiechart pie Underlying piechart object