
The chart program periodically reads data from a file, extracts a
value, and displays these values in one of several formats.  The
default format is a graphical display similar to that of a stripchart
recorder.  Hence the name, "chart".

On systems such as Linux, in which the system parameters are available
in human-readable form in the /proc directory, the chart program makes
a dandy performance monitoring tool, similar to but more versatile
than xload.  

Instead of being limited to a few standard performance parameters, the
chart program can plot any time-variant parameter than can be read
from a file or pipe.  This ability to read data from a pipe provides a
very versatile and easy to use method of setting up custom displays.

The chart program determines the parameters to display by reading a
configuration file.  The chart program will first look for a
configuration file specified on the command line, then look for a file
named .chart.conf in the users home directory, then look for a file
named /etc/chart.conf.  If no configuration file is found, the program
terminated.

There are a few command line switches that can be used to alter the
behavior of the program.

	-h (or anything else unrecognized)
		Prints usage info
	-f <config-file>
		Specifies an alternate configuration file.
	-i <interval>
		Specifies an alternate polling interval.
	-d ( none | text | graph | gtk )
		Specifies an alternate display format:
			none:	no display is produced (for debugging);
			text:	a textual numeric display is produced;
			graph:	a textual graphic display is produced;
			gtk:	use the default gtk-based graphic display.

The configuration file has a paragraph of configuration information
for each parameter to be charted.  Each of these paragraphs are
comprised of a series of RFC-822 style "keyword: value" pairs,
beginning with an "identifier:" line.  A comment can be included by
putting a sharp sign (#) in the first column of a line.  

The following keywords are available.  Some are optional; some are
only used by certain display types; many have reasonable default
values, as described below.

identifier:
	Introduces a parameter definition, and assigns a name to the
	parameter.  This line *must* be the first line of a parameter
	description.

id_char:
	Provides a single-character abbreviation for a parameter.
	Currently unused, this is intended for the non-existant
	character-graphics display mode.

color:
	Determines the color to be used in displaying a parameter.
	The color names and their RGB values are taken from X11/rgb.txt.

filename:
	The file from which a parameter value is read.
	When a filename beginning with a "|" is supplied, input lines
	will be read from a pipe.

pattern:
	The pattern which identifies the line from which a parameter
	value is to be extracted.  If no pattern is provided, the
	first line of the file is used.

fields:
	The number of fields to be split out of the first line which
	matches the pattern.  Splitting is done on whitespace.

equation:
	An equation used to obtain the value to be charted for this
	parameter.

maximum:
	The largest value that can be displayed.  Any value in excess
	of the maximum will be plotted at the top of the display.
	If omitted, a default value of 1.0 is used.

maximum:
	The smallest value that can be displayed.  Any value less than
	the minimum will be plotted at the bottom of the display.
	If omitted, a default value of 0.0 is used.

On each iteration, a value to be displayed is obtained for each
parameter in the configuration file.  The file named in the "filename"
line is opened -- either as a pipe if the filename begins with a pipe
character (|), or as a regular file otherwise -- and a line is read.

If a pattern was specified, lines are read until one is found that
contains the pattern string anywhere in the line.  This line is split
into the number of whitespace seperated fields specified in the
"fields" line.  Each of these fields is interpreted as a floating
point number.

A value is obtained by evaluating the "equation" line using these
field values.  The first (or only) value is denoted by $1, the next by
$2, and so forth.  The difference between the field values between the
last and the current iteration is denoted by ~1, ~2, and so forth.
The elapsed time in seconds between the last and current iteration is
~t.  The requested update interval is $i (and the delta is ~i, but
will always be zero).  All the usual infix arithmatic operators are
available.

