Last Updated: 3/4/97
Class NFBarchart

Class NFBarchart

public class NFBarchart extends NFDataChart

NFBarchart is subclassed from the NFDataChart.

Instance Variables

Type Name Description Default
int barFormat display format for data sets GROUP
int barLayout bar layout for bars. VERTICAL
int stackLabel default stack active label STACKTOTAL

Final Variables

Type Name Description
int GROUP data sets are grouped
int ROWS data sets in different rows
int STACK data sets are stacked
int STACKITEM use item value as stack label
int STACKTOTAL use total as stack label

Constructors

Methods


NFBarchart (Applet a)
Create a new NFBarchart using the entire screen.

NFBarchart (Applet a,
            int x,
            int y,
            int w,
            int h)
Create a NFBarchart that will be displayed within the given region of the screen.

protected void defineParams ()
This method extends the NFDataChart.defineParams() method to define the following HTML parameters:
 	GraphType
 	DataSets
 	DataSet[1-20]
 	BarLabels

void drawBar (Graphics g,
              int x,
              int y,
              int dx,
              int dy,
              Color color,
              int depth)
Draws a bar into the given graphics context. This method may be used by sub-classes when displaying data sets. Assumes both the shadow side and top should be drawn.

void drawBar (Graphics g,
              int x,
              int y,
              int dx,
              int dy,
              Color color,
              int depth,
              boolean drawTop,
              boolean drawSide)
Draws a bar into the given graphics context. This method may be used by sub-classes when displaying data sets.

protected void drawBars (Graphics g)
Draws all bar data sets using the current display parameters

protected void drawData(Graphics g)
called by the superclass to perform the data drawing operation.

protected void drawDataLite (Graphics g)
Since bar charts can't be incrementally updated, just call drawData(g);

protected int get3DDepth (boolean estimate)
Returns the depth used when displaying a 3D bar shadow.

int getBarSize()
Returns the bar size, based on the current chart settings.

protected double[] getMinMax (NFAxis axis)
This method extends the one in NFDataChart and computes the min/max for any stacked bars.

protected double[] getMinMax (NFDataSeries ds,
                              NFAxis axis,
                              double minmax[])
Updates the min/max values for the given data set, along the given axis. This method should be overridden by higher level objects to deal with different data set types.

protected void initBarchart()
initializes the chart, grids and axes. called by constructor.

protected synchronized void loadParams () throws Exception
This method extends NFGraph.loadParams() to load the HTML parameters defined by the defineParams method.
This method may be overridden by sub-classes to load additional parameters. In such cases, this method should be called first.

void reset()
Reset causes the scaling and axes data to be recomputed.

protected void setDefault3DGrid()
sets up the default 3d grid based on the arrangement of the bottom and left axes and the depth.

protected void setDefaultAxes()
sets up the default axes

void setDefaultAxis (NFAxis axis)
Setup the given axis. If one or more bar sets use the axis as a "bottom" axis, then adjust the min/max values to be on a 0.5 boundary, so that the bars are always fully displayed.

void setDefaultGrid()
Configures the bar graph's default grid. This should be overridden by sub-classes for different display formats.