Moth

A 2D Graphing Application SourceForge.net Logo
News
Examples
Documentation
Download
SourceForge
Project

Concepts

Each XML file describes how to generate one or more images. This is done by specifying various data sources and images. The drawing layers of the images then use the data created by the data sources to figure out where to draw.

data sources -> columns

Each data source (<mysql>, <rpn>, <rrd>, and <textfile>) creates a bunch of values and puts them into one or more columns.

Each column holds a single ordered list of values. Columns are created by using the columns attribute common to all data sources. Column names cannot start with numbers, be all UPPERCASE, or contain a comma.

columns -> drawing layers

The image tags which actually draw data (<area>, <line>, <points>, and <segments>) are drawn in layers in the order that they appear in the XML, each drawing over the previous ones.

(<grid> is a special drawing layer. It doesn't draw any of the data specified in the columns. Instead, it draws grid lines to make it easier to eyeball the value of the data presented by the other drawing layers.)

The <line> and <points> drawing layers read data from pairs of columns, and use these pairs to plot points along an X and Y axis. <area> and <segments> draw similarly, except they read from two pairs of data.

Many of the numeric attributes (such as line widths) can also be specified using columns, and in these cases the drawing layer will read a value from the column each time it goes to draw.