public class NFBarchartApp extends Applet
This class supports the generation of barcharts consisting of 1 to 50 data sets, with any number of values assigned to each data set. Data sets can be displayed by grouping together corresponding bars, stacking them or display them in separate rows, and bars can be shown with or without a 3D effect. For every bar displayed, an optional active label can be displayed whenever the mouse cursor "dwells" over that bar. The text value displayed in that label can be specified directly or can be generated automatically from the value represented by that bar. Optionally, a URL can be assigned to that label to allow a "drill-down" to another HTML document or the output from a CGI command.
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
The following parameters are specifically supported by this chart:
GraphType = type;
Defines the type of graph to be displayed. The following types are supported:
GROUP - datasets are grouped together (default) ROWS - datasets are displayed in separate rows STACK - 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, Type1), (Name2, Color2, Type2) ...;
Defines a list of datasets with the given name color and type. The names will be used as items in the Legend, and the color will be used for each bar in the dataset.
The following symbol types are supported: BAR TRIANGLEBAR DIAMONDBAR CYLINDER PIEVERTICAL PIEHORIZONTAL
and determines how the "bar" should be drawn. Note that some types may produce unusual results if the graph type is STACK or ROWS. If one of the "Pie" types is selected, the alternate pie color will be extracted from the first element of the ColorTable.
At most 50 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.
DataAxis = (XAxis1, YAxis1), (XAxis2, YAxis2), ...;
The XAxis and YAxis attributes define the specific axis to be used when mapping the X and Y values respectively for each data set defined. The XAxis attribute may be set to BOTTOM or TOP, while the YAxis may be set to LEFT or RIGHT.
DataSet[1-50] = Number1, Number2, ...;
Defines a list of numeric values for each dataset defined by the DataSets parameter. Each dataset may contain a different number of values. If the value "null" is substituted for a Number, no bar will be drawn in that Number's position.
BarLabels = "String1", "String2", ...;
Defines a list of labels to be displayed below each group of bars. This parameter overrides the BottomLabels parameter (for VERTICAL bars) or the LeftLabels parameter (for HORIZONTAL bars).
BarActiveLabels = ("Label1", "URL1", "Target1"),...;
The BarActiveLabels parameter specifies a list of custom active labels to be associated with each bar label. That is, these labels will be displayed whenever the mouse "dwells" over a given bar label. This can be used to provide the user with additional information about that particular bar grouping or to "drill-down" to another document. See Active Labels for a detailed explanation of active label capabilities.
The BarActiveLabels parameter overrides the BottomActiveLabels parameter (for VERTICAL bars) or the LeftActiveLabels parameter (for HORIZONTAL bars).
Bar3DDepth = Number;
Defines the "depth" of the bar in pixels. A depth of 0 draws a 2D bar.
BarWidth = Number;
Defines the relative width of the bar as a percentage of available space. A smaller number results in more space between bars.
StackLabel = type;
Defines how the default active labels should be generated for each bar in a stacked barchart. The following types are supported:
TOTAL - use the accumulated total for the label (default) ITEM - use the individual item value for the label
The following HTML segment defines a bargraph containing two sets of bars, displayed in different rows.
<applet code=NFBarchartApp.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 = ROWS; GraphLayout = VERTICAL;
DataSets = ("Set #1", blue), ("Set #2", red); DataSet1 = 100, 200, 300, 400, 200; DataSet2 = 40, 30, 20, 10, 500;
BarLabels = "Mon", "Tues", "Wed", "Thur", "Fri";
BottomTics = ("ON", black, "TimesRoman", 14);
LeftTics = ("ON", black, "Courier", 16); LeftScale = (0, 1000);
Grid = (black, lightGray, black);
DwellLabel = ("", black, "TimesRoman", 16); DwellBox = (cyan, SHADOW, 5);
ActiveLabels1 = ("8%", "DemoURL#firstPage", "NewWindow"), ("16%", "DemoURL#secondPage"), ("25%", "DemoURL#thirdPage"), ("33%", "AnotherURL"), ("16%", "");
'> </applet>
Type | Name | Description | Default | ||||
public | NFBarchart | Underlying barchart object | bar |