Last Updated: 3/4/97
Class NFStockChartApp

Class NFStockChartApp

public class NFStockChartApp extends Applet

This class supports the generation of stock charts showing hi/lo/open/close values for a given day/time. In addition, the chart can display a set of Bar and/or XY line sets, with optional symbols, lines and area fills.

The Stock Chart accepts all of the same display parameters found in the NFComboChartApp applet. The user need only specify Y values for any barsets, while specifying (x,y) coordinates for each line dataset.

In all cases, the user can specify the specific axes to be used for a given stock, bar or line set. That is, for each data set, the user can specify either the bottom or top, and left or right axis to be used for data mapping purposes. 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 trading volume vs. stock value.)

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

 	TopAxis
 	LeftAxis
 	RightAxis
 	BottomAxis

 	Grid
 	GridLine
 	GridAxis

 	ColorTable

 	NoteSets
 	NoteSets[1-20]
 	NoteArrow
 	NoteAxis
 	NoteLabel
 	NoteBox

Additionally, all of the Combo Chart parameters are supported by this chart, including:

 	GraphType
 	GraphLayout

 	DataSets
 	DataAxis
 	DataSet[1-50]

 	BarLabels
 	BarActiveLabels

 	StackLabel

 	LineSets
 	LineAxis
 	LineSet[1-50]
 	LineLabels[1-50]

The following parameters are specifically supported by this chart:

StockSets = (Name1, Color1, Width1, TicLen1), (Name2, Color2,...);

 	Defines the display attributes for one or more stock
 	data sets.  The Name attribute is used if a legend is
 	displayed.

 	The color attribute defines the bar color to be used for
 	the vertical bar (hi/lo) and the horizontal ticks 
 	(open/close). A default color is taken from the 
 	ColorTable if the color attribute is set to "null".

 	The Width attribute defines the width of the vertical
 	bar (hi/lo), while the TicLen attribute defines the
 	length of the open/close tic marks.  If TicLen is set to
 	0 then no tic marks will be displayed.

StockAxis = (XAxis1, YAxis1), (XAxis2, YAxis2), ...;

 	The XAxis and YAxis attributes define the specific axis
 	to be used when mapping the X and Y values respectively.
 	The XAxis attribute may be set to BOTTOM or TOP, while 
 	the YAxis may be set to LEFT or RIGHT.

StockData[1-50] = (stock tuple1), (stock tuple2),...;

 	Defines a list of stock values with the following 
 	attributes in each tuple:

 	hi    - highest stock value (Number)
 	lo    - lowest stock value (Number)
 	open  - opening stock value (Number)
 	close - closing stock value (Number)

 	If the <lo> value is not defined, then the <hi> value 
 	will be used.  If the <open> or <close> values are not 
 	defined, then no tic mark will be drawn for that value.

StockLabels[1-50] = ("Label1", "URL1", "Target1"), ...;

 	This parameter can be used to override the default 
 	active labels generated for each data value and/or to 
 	specify a hyper-link to another document, in a given 
 	target window or frame.

The following HTML segment defines a Stock Chart containing one set of stock values, with a bar set showing the trading volume and a line set showing the S&P500. NOTE: All data sets use the same X-axis, but different Y-axes, depending on the data type.

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

 	Background   = (white);

 	Header       = ("XYZ Stock \n(Last 10 Weeks)", white);
 	HeaderBox    = (darkGray, RECESS, 5);

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

 	BottomFormat = (INTEGER, "Week=%d");
 	BottomTics   = ("ON", black, "TimesRoman", 12);
 	BottomLabels =	"May", "", "", "", "", "",
 			"Jun", "", "", "", "",
 			"Jul", "", "", "", "", "";

 	LeftTics    = ("ON", blue, "TimesRoman", 12, 0);
 	LeftColor   = blue;
 	LeftScale   = (0, 75);

 	RightTics   = ("ON", green, "TimesRoman", 12, 0);
 	RightColor  = green;
 	RightScale  = (0, 3000);

 	DwellLabel  = ("ON", black, "Courier", 10);
 	DwellBox    = (yellow, SHADOW, 4);

 	StockSets   = ("Value", blue, 2, 2);
 	StockAxis   = (BOTTOM, LEFT);

 	StockData1 =
 	(47,33,35,33), (47,32,41,37), (49,43,46,48), (51,39,40,47),
 	(60,40,46,53), (55,43,45,47), (54,33,40,51), (58,42,44,57),
 	(54,38,43,52), (48,41,44,41);

 	DataSets = ("Volume", green);
 	DataAxis = (TOP, RIGHT);

 	DataSet1 =
 	812, 520, 633, 913, 519, 562, 697, 763, 709, 528, 738;

 	LineSets = ("S&P500", red, NONE, 1, FILLED, SOLID, 1, red);
 	LineAxis = (BOTTOM, LEFT);

 	LineSet1 =
 	(0,35), (1,39), (2,37), (3,31), (4,31), (5,38), (6,39),
 	(8,36), (9,38), (10,39), (11,39), (12,36), (13,40);

 	'> </applet>

Instance Variables

Type Name Description Default
public NFStockChart Underlying stock object stock