About The Applets

JavaChart applet behavior is defined by using the APPLET and PARAM tags. These charts can be embedded into your documents in a static manner, but they're much more interesting if you build them on the fly. You can accomplish this by building a gateway application that writes out the appropriate HTML text with JavaChart APPLET and PARAM tags, or you can use a static chart definition that updates its data dynamically with JavaChart's URL options.


The Applets

The current JavaChart basic applet collection includes the following:

Active Applets

JavaChart also includes applets that can be manipulated by user input. These use standard JavaChart functions, combined with Java user interface controls to provide various kinds of interactive chart. These include the following:

Contributed Applets

With thousands of JavaChart users, quite a few applets have been contributed that provide meaningful coding examples or demonstrate interesting functionality. Many of these applet simply read alternate data formats, or give samples of interesting color and layout schemes. Others provide significant extensions to JavaChart's base functionality. Some of the more interesting samples include:

Using the Applets

JavaChart applets use conventional HTML tags for Java applets. The "APPLET" tag names one of the classes listed above. This tag is followed by any number of "PARAM" tags, which specify the look and behavior of the applet on the page. Probably the easiest way to get started with a JavaChart applet is to grab the HTML source from one of the samples linked to this page, and then make whatever changes you require.

Each applet requires some of the files in the JavaChart package, the applet class itself, and a class file called "ChartAppShell.class". To use the software on your own server, you will need to make sure your server has at least the following files:


General Applet Parameters

Because of JavaChart's modular construction, some of the applet parameters are shared by all the applets, and some are specific to particular kinds of charts. The following parameters are shared by the entire applet collection, and are related to general charting features. This table and those that follow use these conventions for describing the kind of argument each parameter requires:  
Parameter value type effect
titleString String Chart Title (default none) 
titleFont font Font name, size, & style for chart title (default TimesRoman, plain, 12 pt)
titleColor color color of text in legend (default black)
legendOn anything make the legend visible
legendOff anything make the legend invisible (default)
legendColor color sets the background color of a legend
legendVertical anything legend icons in vertical list (default)
legendHorizontal anything legend icons in horizontal list
legendLabelFont font Font name, size, & style for legend (default TimesRoman, plain, 12 pt)
legendLabelColor color color of text in legend (default black)
legendllX double X location of lower left legend corner (default 0.2)
legendllY double Y location of lower left legend corner (default 0.2)
iconWidth double width of legend icon (default 0.07)
iconHeight double height of legend icon (default 0.05)
iconGap double gap between icon and next legend entry (default 0.01)
plotAreaTop double top of the plotting area
plotAreaBottom double bottom of the plotting area
plotAreaRight double right side of the plotting area
plotAreaLeft double left side of the plotting area
plotAreaColor color color of plotting area background (default white)
backgroundColor color color of chart background (default white)
3D anything turns on 3D effects for this chart (default 2D)
2D anything turns on 2D effects for this chart (default 2D)
xDepth integer number of pixels of offset in X direction for 3D effect (default 15)
yDepth integer number of pixels of offset in y direction for 3D effect (default 15)

Line Chart Specific Parameters

The following table contains parameters that can be used with all Line and Regression Charts.
 
Line Chart Parameters value type effect
plotLinesOn anything lines are visible (default)
plotLineOff anything plot lines are invisible
dataset0Image URL a dataset parameter currently only used by Line charts (default none)
labelsOn anything displays a data label at each point (default is not visible)
labelAngle integer rotates data labels to the specified angle
labelFormat 0,1,2 Default, Comma, or European format
labelPrecision integer maximum number of places beyond the decimal point to display


Finance Chart Specific Parameters

The following table contains parameters that can be used only with the finCombo applet.
 
Finance Chart Parameters value type effect
dataset0Type HLOC|Stick|Line how should dataset 0 be represented?
Note: This chart extends DateLineChart functionality, and includes other parameters specific to Date axes. This chart takes it's data from a single file. The first column in the file contains dates. Additional columns are processed as follows: Line and Stick consume one column each, HLOC consumes 3 columns. 

BarLine Chart Specific Parameters

The following table contains parameters that can be used only with the barLine applet.
 
BarLine Chart Parameters value type effect
dataset0Type Bar|Line how should dataset 0 be represented?
Note: This chart extends LabelLineChart functionality, and includes other parameters specific to both labelLineApp and barApp.


BarArea Chart Specific Parameters

The following table contains parameters that can be used only with the barLine applet.
 
BarArea Chart Parameters value type effect
dataset0Type Bar|Area how should dataset 0 be represented?
Note: This chart extends AreaChart functionality, and includes other parameters specific to both areaApp and barApp.


Bar Chart Specific Parameters

The following table contains parameters that can be used with any kind of bar or column chart. These include bar, column, indBar, indColumn, stackBar, and stackColumn
 
Bar Chart Parameters value type effect
barLabelsOn anything label each bar
barLabelsOff anything make bar labels invisible (default)
barBaseline double bars ascend or descend from this value (default 0.0)
barClusterWidth double relative width of a cluster of bars (default 0.8)
barLabelAngle integer degrees to rotate bar labels (default 0)
labelFormat integer 0: default, 1: comma format, 2: european format (default 0)
labelPrecision integer maximum number of digits to display past the decimal point

Pie Chart Specific Parameters

The following table contains parameters only used by pie charts. Other chart types ignore these parameters
 
Pie Chart Parameters value type effect
explodeSlice integer slice number to explode
textLabelsOn anything make string labels visible
textLabelsOff anything make string labels invisible (default)
valueLabelsOn anything make numeric labels visible
valueLabelsOff anything make numeric labels invisible (default)
percentLabelsOn anything make percentage labels visible (default)
percentLabelsOff anything make percentage labels invisible
labelPosition integer 0: at center of slice, 1: at edge of slice, 2: outside edge of slice with pointer
labelFormat integer 0: default, 1: comma format, 2: european format (default 0)
labelPrecision integer maximum number of digits to display beyond decimial point
startDegrees integer degrees counterclockwise from 3 o'clock for first slice
xLoc double x Location for center of pie (between 0 & 1, default 0.5)
yLoc double y Location for center of pie (between 0 & 1, default 0.5)
pieWidth double % of window for pie diameter (default .6 = 60%)
pieHeight double % of window for pie diameter (default .6 = 60%)
labelColor color Color for pie labels (default black)
labelFont font Color for pie labels (default TimesRoman 12pt)

Speedo Chart Specific Parameters

The following table contains parameters only used by speedo charts. Other chart types ignore these parameters
 
Speedo Chart Parameters value type effect
needleStyle integer Kind of needle (default 1) 0 = arrow, 1 = line, 2 = thick arrow, 3 = swept arc
speedoPosition integer 0 (default) is a mostly complete circle, 1 - 4 are semi circles in various positions, 5-8 are quarter circles in various positions
labelsInside anything labels on the inside of the speedo
labelsOutside anything labels on the outside of the speedo
watermarkColor color for hSpeedoApp, determines the color of the history watermark
alarmThreshold double not yet implemented

Axis Parameters

The following tables contain parameters for adjusting axes. Line, area, bar, and their derivatives use these parameters. Axis parameters consist of a set of parameters and an option list. The option list is contained in a separate table.
 
Y Axis Parameters value type effect
yAxisTitle string Y Axis title
yAxisTitleFont font Y Axis title font
yAxisTitleColor color Y Axis title color
yAxisLabels list comma separated list of labels for the Y axis
yAxisLabelFont font use this font for Y axis labels (default TimesRoman 12pt)
yAxisLabelColor color Y axis labels in this color (default black)
yAxisLabelAngle integer label rotation in degrees (default 0)
yAxisLabelFormat 0:default, 1:Comma, 2:European (default 0)
yAxisLabelPrecision integer maximum number of digits past the decimal point to display
yAxisLineColor color Y axis line color (default black)
yAxisTickColor color Y axis tick mark color (default black)
yAxisGridColor color Y axis grid line color (default black)
yAxisColor color sets Y axis grids, ticks, lines and labels to the same color
yAxisTickLength integer number of pixels long for Y axis tick marks
yAxisMinTickLength integer number of pixels long for Y axis minor tick marks
yAxisStart double starting value on Y axis if not autoscaled (default 0.0)
yAxisEnd double ending value on Y axis if not autoscaled (default 10.0)
yAxisLabelCount integer how many labels on a manually scaled axis
yAxisTickCount integer how many tick marks on a manually scaled axis
yAxisMinTickCount integer how many minor tick marks on a manually scaled axis
yAxisGridTickCount integer how many grid lines on a manually scaled axis
The following (and very similar) list of parameters is for the X axis. X axes can be on the top or bottom of a chart, and can be visible or invisible, automatically or manually scaled, with or without ticks, labels, grid lines, etc.
 
X Axis Parameters value type effect
xAxisTitle string X Axis title
xAxisTitleFont font X Axis title font
xAxisTitleColor color X Axis title color
xAxisLabels list comma separated list of labels for the X axis
xAxisLabelFont font use this font for X axis labels (default TimesRoman 12pt)
xAxisLabelColor color X axis labels in this color (default black)
xAxisLabelAngle integer label rotation in degrees (default 0)
xAxisLabelFormat 0:default, 1:Comma, 2:European (default 0)
xAxisLabelPrecision integer maximum number of digits past the decimal point to display
xAxisLineColor color X axis line color (default black)
xAxisTickColor color X axis tick mark color (default black)
xAxisGridColor color X axis grid line color (default black)
xAxisColor color sets X axis grids, ticks, lines and labels to the same color
xAxisTickLength integer number of pixels long for X axis tick marks
xAxisMinTickLength integer number of pixels long for X axis minor tick marks
xAxisStart double starting value on X axis if not autoscaled (default 0.0)
xAxisEnd double ending value on X axis if not autoscaled (default 10.0)
xAxisLabelCount integer how many labels on a manually scaled axis
xAxisTickCount integer how many tick marks on a manually scaled axis
xAxisMinTickCount integer how many minor tick marks on a manually scaled axis
xAxisGridCount integer how many grid lines on a manually scaled axis

Axis Option Lists

The following lists include various options for adjusting the look of an X or Y axis. Use these parameters in a list, like this: param name=xAxisOptions value="gridOff, tickOff, lineOn"
 
yAxisOptions
autoScale automatically create axis scale (default)
noAutoScale axis scale defined in applet parameters
lineOn axis line is visible (default)
lineOff axis line is invisible
tickOn major tick marks are visible (default)
tickOff major tick marks are invisible
minTickOn minor tick marks are visible
minTickOff minor tick marks are invisible (default)
labelOn axis labels are visible
labelOff axis labels are invisible (default)
gridOn grid lines are visible
gridOff grid lines are invisible (default)
rightAxis Y axis goes on the right
leftAxis Y axis goes on the left (default)
The following, similar, list contains various options for the X axis.
 
xAxisOptions
autoScale automatically create axis scale (default)
noAutoScale axis scale defined in applet parameters
lineOn axis line is visible (default)
lineOff axis line is invisible
tickOn major tick marks are visible (default)
tickOff major tick marks are invisible
minTickOn minor tick marks are visible
minTickOff minor tick marks are invisible (default)
labelOn axis labels are visible
labelOff axis labels are invisible (default)
gridOn grid lines are visible
gridOff grid lines are invisible (default)
rightAxis X axis goes on the right
leftAxis X axis goes on the left (default)
The following list contains options for Time/Date X axes, such as those used for dateLineApp.class and dateAreaApp.class. For more details on DateAxis operation, click here. To see some sample Date/Time axis charts, click here
 
DateAxis Options
startDate string time/date for axis starting value. Note: this string is passed into Java's "Date" class to be translated into a machine independent time stamp. Many time-stamp formats will work
endDate string time/date for axis ending value
scalingType integer
1 scale by seconds
2 scale by minutes
3 scale by hours
4 scale by days
5 scale by weeks
6 scale by months
7 scale by years
 

Dataset Specification

Datasets can vary a great deal from chart to chart. Some kinds of charts only use Y values, others use both X and Y values. Some charts use a color to represent an entire dataset (bar charts, line graphs), and some use a color for each data value (pie charts, individual bar charts). In general, every chart must define a list of numbers for Y data. Charts that don't define this data will use an internally generated fake dataset, which is pretty useless. For additional ways to define data, see the table on URL datasets.
 
Dataset Parameters (available datasets 0 through 19)
dataset0xValues list comma separated list of X values for dataset 0
dataset0yValues list comma separated list of Y values for dataset 0
dataset0y2Values list comma separated list of difference values for dataset 0 hilo bars
dataset0xyValues list comma separated list of XY pairs for dataset 0
dataset0dateValues list comma separated list of date strings for dataset 0
dataset0Name string name for display in legend (default "dataset0")
dataset0Labels list comma separated labels for data items
dataset0Color color color to use for this dataset (default varies)
dataset0Colors list of colors colors to use for pie slices or bars (default varies)
dataset0Image URL image to use for this dataset's markers (default none)
dataset0LabelFont font font to use for this dataset's labels (default TimesRoman 12pt)
dataset0LabelColor color color to use for this dataset's labels (default black)
customDatasetHandler string information passed to a user-defined dataset handling method "void getMyDatasets(String str)" Note: in the case of DateAxis, this is the URL for a data file that contains columnar Date information

URL Dataset Parameters

These applets include a mechanism to retrieve data from a valid URL. Current Java restrictions in Navigator generally require this URL to use the same host the applet came from. You can use this mechanism to keep your chart definitions and Web pages unchanged while modifying data files as frequently as you wish. You can also specify a network retrieval interval that causes the JavaChart applets to re-read data from the specified URL, updating the chart as necessary.
 
URL Dataset Parameters (available datasets 0 through 19)
dataset0xURL URL URL for a file of comma separated X values for dataset 0
dataset0yURL URL URL for a file of comma separated list of Y values for dataset 0
URLDataBlock URL URL for a file of comma separated Y values. Each line in this file is assumed to be a unique dataset.
URLXYDataRows URL URL for a file of comma separated XY pairs arranged into rows. Each row represents a single dataset, with values arranged as x1, y1, x2, y2, x3, y3... 
URLXYDataColumns URL URL for a file of comma separated XY pairs arranged into columns. This file must contain a single value as the first line of the file, specifying the number of observations (rows) in the file. The first two columns are dataset 1, the second two columns are dataset 2, etc.
networkInterval integer Number of seconds to wait before re-reading URL datasets
customDatasetHandler string information passed to a user-defined dataset handling routine "void getMyDatasets(String str)" Note: in the case of DateAxis, this is the URL for a data file that contains columnar Date information

Active Applet Parameters

This is a collection of parameters for the various active JavaChart applets. Line oriented applets also take all Line parameters, Bar applets take Bar parameters, and so on.
Active Applet Parameters
scrollWindows integer how many windows should be in the entire scrollbar (default 10) for scrollingLine
dataset0Links list a delimiter separated list of URLs for this dataset's bars (used in hyperColumn and hyperBar)
backgroundImage URL specification for an ImageChart background.