Last Updated: 12/20/96
Class NFComboChartApp

Class NFComboChartApp

public class NFComboChartApp extends Applet

This class supports the generation of combination barcharts, line charts and area filled charts. The combo chart accepts a set of bar data sets and line data sets, with most of the same display parameters found in the NFBarchartApp and NFXYChartApp applets. Bars may be displayed in either a stacked or grouped arrangement, similar to the barchart applet. Bars are always drawn first, with the line data sets drawn over them. The user may specify (x,y) coordinates for each line dataset, mapping those values to the screen using either the bottom or top and left or right axes. This allows the generation of charts in which the line set values are either consistent with the bar values (such as min/max line sets) or are best drawn using their own coordinate systems (such as a plot of average employee age vs. salary by age.)

The following standard parameters are supported by this chart:

 	Background

 	Header
 	HeaderBox
 	Footer
 	FooterBox
 	LeftTitle
 	LeftTitleBox
 	RightTitle
 	RightTitleBox

 	DwellLabel
 	DwellBox
 	ActiveClicks
 	ActiveLabels[1-20]

 	Legend
 	LegendBox
 	LegendItems

 	TopAxis (see description below)
 	LeftAxis
 	RightAxis (see description below)
 	BottomAxis

 	ColorTable

The following parameters are specifically supported by this chart:

GraphType = format;

 	Defines the format of bar sets to be displayed.  The 
 	following types are supported:

 	GROUP - bar datasets are grouped together (default)
 	STACK - bar datasets are stacked

GraphLayout = type;

 	Defines the bargraph orientation.  The following 
 	types are supported

 	HORIZONTAL - bars are oriented left to right.
 	VERTICAL - bars are oriented bottom to top.

 	Note that the BarLabels resource will be displayed on
 	the left axis for HORIZONTAL bargraphs and the bottom
 	axis for VERTICAL bargraphs.

DataSets = (Name1, Color1), (Name2, Color2) ...;

 	Defines a list of bar datasets with the given name and 
 	color. The names will be used as items in the Legend, 
 	and the color will be used for each bar in the dataset. 
 	At most 20 bar datasets may be displayed.

 	If a color 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.)
 	Furthermore, if only a single data set is defined and
 	no color value is assigned (or null is assigned) then
 	EVERY bar in that data set will be given a different
 	default color, depending on its position.

DataSet[1-20] = Number1, Number2, ...;

 	Defines a list of numeric values for each dataset defined 
 	by the DataSets parameter.  If the value "null" is substituted 
 	for a Number, no bar will be drawn in that Number's position.

LineSets = (lineset1 tuple), (lineset2 tuple),...;

 	Defines a list of lineset tuples with the following attributes
 	in each tuple:

 	"Name"    - Name assigned to this data set
 	SymColor  - Symbol Color
 	SymType   - Symbol Type (CIRCLE, SQUARE, DIAMOND, CROSS,
 				 TRIANGLEDOWN, TRIANGLEUP)
 	SymSize   - Symbol Size (in pixels)
 	SymStyle  - Symbol Style (FILLED, OUTLINED)
 	LineType  - Line Type (SOLID, DOTTED, DASHED, DOTDASH)
 	LineWidth - Line Width (in pixels)
 	LineColor - Line Color
 	FillColor - Fill Color

 	See NFXYChartApp for more details concerning line set
 	attributes.

LineSet[1-20] = (x1,y1), (x2,y2), ...;

 	Defines a list of (x,y) values for each line dataset 
 	defined by the LineSets parameter.  If "null" is substituted for
 	either or both of the x/y pair value's, the point will not be drawn.

LineLabels[1-20] = ("Label1", "URL1", "Target1"), ...;

 	Same as ActiveLabels[1-20] except that the labels correspond
 	to the line datasets that have been defined.

TopAxis = (Axis Tuple);

RightAxis = (Axis Tuple);

 	If either of these parameters is defined, this axis will
 	be used to determine the location of each data point in 
 	the defined LineSets.  That is, the line set X or Y data
 	values are mapped using the min and max values specified
 	for this axis. The TopAxis and RightAxis is displayed by
 	default, but may be defined without displaying it by 
 	specifying "null" for the AxisColor.

 	If either of these axes are not defined, then the X or Y
 	values for each line data set will be mapped using the 
 	BottomAxis or LeftAxis settings.

BarLabels = "String1", "String2", ...;

 	Defines a list of labels to be displayed below each 
 	group of bars.

Grid = (LineColor, BGColor, BorderColor);

 	Defines the grid to be displayed behind the bars. If 
 	this parameter is not defined, no grid is displayed. If 
 	the BGColor is not defined, only grid lines are
 	displayed.

The following HTML segment defines a combo chart containing two sets of bars, displayed in groups, with three line data sets showing the min, max and average values. NOTE: The line and bar sets use the same LeftAxis and BottomAxis coordinates to line up the data values and bars. This is not always necessary or desired. In other cases, the TopAxis and RightAxis may be specified.

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

 	Background      = (white, NONE, 4);

 	Header          = ("This is a Demo\nWith A 2-Line Header");
 	HeaderBox       = (lightGray, RAISED, 5);

 	Legend          = ("Legend", black, "TimesRoman", 18);
 	LegendBox       = (lightGray, SHADOW, 5);

 	GraphType       = GROUP;
 	Bar3DDepth	= 5;

 	DataSets        = ("Set #1", blue), ("Set #2", red);
 	DataSet1        = 100, 200, 300, 400, 200;
 	DataSet2        = 40, 30, 20, 10, 500;

 	LineSets        = ("Min",yellow,CROSS,10,FILLED,
 				 SOLID,2,magenta,null),
 			  ("Avg",orange),
 			  ("Max",cyan);

 	LineSet1        = (0.2,40), (1.2,30), (2.2,20),
 			  (3.2,10), (3.8,200);
 	LineSet2        = (0,70), (1,115), (2,155), (3,205), (4,350);
 	LineSet3        = (-0.2,100), (0.8,200), (1.8,300),
 			  (2.8,400), (4.2,500); 

 	BarLabels       = "Mon", "Tues", "Wed", "Thur", "Fri";

 	BottomTics      = ("ON", black, "TimesRoman", 14);
 	LeftTics        = ("ON", black, "Courier", 16);

 	Grid            = (black, lightGray, black);

 	DwellLabel      = ("", black, "TimesRoman", 16);
 	DwellBox        = (cyan, SHADOW, 5);

 	'>
 	</applet>