[Rated Top 5% WebApplet by JARS] [Featured in Gamelan's Best Java CD-ROM]

TimeGraph Applet


TimeGraph is a graphing applet, especially suited to graphing real-world internet statistics such as network throughput or web hits. Up to 8 datasets can be plotted on the same graph and the graph can be zoomed into for better examination.

Parameters can also be graphed as deltas, ie. the differences between consecutive values; it can automatically select the groups with the highest-valued parameters; and most of its configuration can be changed without restarting the applet.

Note that it relies on the X index being a timestamp, and only plots linegraphs. It was designed for use to plot network statistics, but it'd be useful for any other numeric statistics whose progress over time needs to be graphed, eg. CPU usage, web hits, temperature, etc.


(the applet would be here, normally!)

Using the Applet

Hit the Configure... button to display a window where you can select each data set to graph, using the following parameters for each one: the group to graph, the parameter in that group, the scale to use, and any special treatment the data should get (eg. plot as deltas, etc.) Use the Zoom In and Zoom Out buttons to select the area of the graph you want to view. If you drag an area of the graph before zooming in, it will zoom in on that area. Hit Reset if you zoom in too far and couldn't be bothered zooming out again; it'll reset the graph's ranges to where they were when you started zooming.

Applet Tag Parameters


The Statistics File Format

Each line represents a single set of statistics at a specific time, for a number of different "groups" of parameters. Each group represents one entity, eg. an individual link to another site, and within each group is a number of different parameters.

The timestamp is separated from the groups by whitespace (one or more spaces or tabs), and the groups are separated from each other by whitespace. End-of-line signifies that there's no more statistics from that point in time.

The timestamp takes the following format:

Eg. 19:20 Sun 17/03/96 . To use US-style dates, eg. 19:20 Sun 03/17/96 , use the usdates applet parameter.

Each group looks like:

Each group must have a name string parameter, and all the parameters apart from the name must be numeric, either in floating-point or integer representations. Scientific notation, eg. "1e+6", is not supported (because it's not supported by the JDK StreamTokenizer ;).

Here's the statistics data file used above, so you can see the format.


Licensing and Distribution

This software is now free software. Use as you see fit, including hack the source and so on, but the existing copyright notices must be retained, intact. Additional notices, to copyright your own modifications, may be added though.

Archives containing the source files, these pages describing the applet, and pre-built class files, can be downloaded here.

  1. In Windows .ZIP format: tgsource.zip (110k)
  2. In UNIX .tar.gz format: TimeGraph.tar.gz (90k)


The Source

I've included a version of the JDK's StreamTokenizer class which fixes a bug in treating space as a special character; the fixed source for it is here . This will (hopefully ;) become unecessary with a future version of the JDK. The rest of the source is listed below.

  1. TimeGraph.java
  2. TimeStatsCanvas.java
  3. StatsReader.java
  4. StatsStreamTokenizer.java
  5. SetupFrame.java
  6. AboutFrame.java
  7. ColourButton.java


Note About the Sample Graph

The sample graph above is of IONA's internet link throughput around December 1995.


If You Find TimeGraph Useful

If you find TimeGraph useful, or use it in any interesting projects, please drop me a line at jmason@iona.com .


Reviews

  1. A "very good" review from JARS .


Last change: Apr 14 1998 jmason