Graph

Before you insert this applet, make sure that the document you are inserting it in has been saved at least once.

To insert the applet, drag and drop the mouse (8) into a HoTMetaL PRO document. A Design-Time Control window that will allow you to configure the applet will appear.

Graph Applet 8

Overview

This applet will generate an simple bar or line graph based on a data file containing a comma-separated list of values. Note: At the time of this release, this applet runs only in Netscape Navigator 3.0.

The data file must contain two lines:

  • First line: comma-separated X (horizontal) values. These values can be numbers or text.
  • Second line: comma-separated Y (vertical) values. These values must be numbers.

The two lines should have the same number of values.

For example:

Jan,Feb,Mar,Apr,May,Jun
20,50,30,60,65,40

Setting up the graph

When you drag this applet to the HoTMetaL PRO document, a dialog box (called a Design-Time Control) appears; this enables you to set up the graph.

The fields in this dialog box should be filled out as follows:

Applet parameters

  • Height and Width specify the amount of space in the main browser window that will be reserved for this applet. These set the the height and width of the graph. The chart scales automatically to the specified dimensions, but this could cause some labels on the horizontal axis to be removed to make everything fit. If you wish to correct this, you can increase the width from this dialog box.
  • Site Root Dir: choose the folder in which the HTML page containing the applet has been saved. (This is necessary if you wish to preview the applet from your local disk.)
  • Use FastLoader: a program that speeds up the loading of the applet.

Graph Parameters

  • Datafile URL: the data file containing the list of values. The default extensions for this file are .csv, .txt, and .dat.
  • Grid Color, Axis Color, Background Color, Bar Color: colors for the grid, axes, and background, and the bars in a bar graph.
  • Graph type: the data can be represented by vertical bars or a line that connects the data points.

Click on OK when you have finished the setup. You can display this dialog box again by right-clicking on the applet icon and choosing DTC Properties... from the pop-up menu.

Displaying the graph

When the browser opens the page, it automatically loads the applet and displays the graph.

Java Applets by Mindquake Software Inc.