Big Faceless Graph Library 2.3 Tag Documentation - Copyright © 2006 Big Faceless Organization

axis

Description

The "axis" tag can be used inside an axesgraph tag to further define an axis. Mandatory attributes are pos and type.

Valid Children

label?

Examples

Example: Plot currencies on the left axis
<axesgraph width="200" height="200">
  <axis pos="left" type="currency" />
  ...
</axesgraph>
Example: Plot integer values on the left axis on a base-10 logarithmic scale from 0 to 100000
<axesgraph width="200" height="200">
  <axis pos="left" type="log(integer, 10)" min="0" max="100000" />
  ...
</axesgraph>
Example: Plot bars on the bottom with a 45 degree rotation and add a Z-axis
<axesgraph width="200" height="200">
  <axis pos="bottom" type="bar" rotate="45" align="left top" paddingtop="2" />
  <axis pos="z" type="zaxis" />
  ...
</axesgraph>

See Also

Attributes

type String mandatory XML / Tag Library

Description

Set the type of axis to use. This value is a String which can be one of the following values:
intInteger values
floatReal values
currencyCurrency values in the default Locale
dateDate values in the format "dd-MMM-yyyy"
decimal(format)Numeric values. format is a string that will be passed in to the constructor of the DecimalFormat class, eg decimal(#0.00%)
currency(code)Currency values in the specified Locale, eg currency(US). The exact format depends on the locale
date(format)Date values. format is a string that will be passed in to the constructor of the DateFormat class, eg date(yyyy-MM)
barBar values. The default on the X axis when plotting bars
nulla Null axis, for plotting no values at all.
zaxisThis and null are the only acceptable values when pos="z".
log(axis[,base])A "wrapper" around another axis to plot logarithmic values, eg log(int) to plot base-10 integer values, log(currency(US), 2) to plot base-2 USD amounts or log(float, E) to plot floats with a natural log base. The base is optional and if not specified defaults to "10"
gap(axis, min, max[, size])A "wrapper" which puts gaps in another axis. For example to plot values from 0 to 50, have a gap to 200 and then plot values to 250, try gap(int, 50, 200). As with the log axis, axis can be any type of axis (you could conceivably have gap(gap(int, 50, 200), 300, 500)). The optional size parameter is the size of the "gap marker", which may be any integer from 0 to 50.
constructorTo use a custom subclass of Axis, you can specify a constructor here, complete with arguments (which may be doubles, floats, ints, booleans, chars or Strings). For instance, if you have a subclass of Axis called "com.yourcompany.MyAxis" with a constructor like MyAxis(String foo, double bar), you could specify <axis pos="left" type="com.yourcompany.MyAxis(Some Text, 1.0)" />
pos top | left | bottom | right | z mandatory XML / Tag Library

Description

Which axis we're defining. This value must be specified, although it may be abbreviated to the first letter (ie "l" for "left")
min Real or Date optional XML / Tag Library

Description

The minimum value to plot on an axis. This can only be used to extend the graph, not contract it - for example if you're plotting values from -10 to 10 and you set min="0", it will be overridden and reset to "-10". On the other hand, a value of "-20" would work. A date may be specified but obviously only makes sense if the axis is a Date axis.

See Also

max Real or Date optional XML / Tag Library

Description

The maximum value to plot on an axis. This can only be used to extend the graph, not contract it - for example if you're plotting values from -10 to 10 and you set max="0", it will be overridden and reset to "10". On the other hand, a value of "20" would work. A date may be specified but obviously only makes sense if the axis is a Date axis.

See Also

wallpaint Paint optional XML / Tag Library

Description

Set the color to paint the "wall" between this axis and the back of the graph. For 2D graphs this wall is invisible so there's no point in setting it, but for 3D graphs this can be used to create a box effect around the data. The values can either be a regular Paint, or stripe(Paint* [, line=Color]) to paint the wall in alternating stripes, with an option line between then.

Examples

Example: Paint the left wall in solid gray
<axis pos="left" type="int" wallpaint="#E0E0E0">...</axis>
Example: Paint the left wall in yellow and gray stripes
<axis pos="left" type="int" wallpaint="stripe(yellow,gray)">...</axis>
Example: Leave the left wall transparent except for a grid of gray lines
<axis pos="left" type="int" wallpaint="stripe(line=gray)">...</axis>
zerointersection Boolean optional XML / Tag Library

Description

When plotting this axis, whether to plot it so it intersects the other axis at the edge of the graph (the default) or where the other axis=0. Typically you would only set this to true when plotting values that run either side of zero - a Sine curve, for example.
stretchends Boolean optional XML / Tag Library

Description

When using Numeric or Date axes, whether to "stretch" the ends of the axes to the nearest round number or date. When this setting is on (the default), plotting values from 1 to 89 will typically result in an axis that runs from 0 to 90. Setting this to false would cause the axis to only run over the range of the data. For finer control the min and max attributes can be set.
barwidth Integer optional XML / Tag Library

Description

Only has an effect on Bar axes when dates are being plotted on the same axis. This attribute controls the nominal "width" of the bar in seconds.
barsatnoon Boolean optional XML / Tag Library

Description

Only has an effect on Bar axes when dates are being plotted on the same axis. This attribute controls whether the bar should be centered at "noon" or "midnight". The default, midnight, means the bar is centered on the line, but when plotting a value that represents a whole day it makes more sense to set this to "true". Hard to explain but easy to visualize, we suggest you try it.
density normal | sparse | minimal optional XML / Tag Library

Description

For most types of axis, this attribute controls how many teeth are drawn. The default is normal, which can look to crowded on some graphs.
toothlength Real >= 0 optional XML / Tag Library

Description

The length of each tooth. The value is specified as a proportion of the width of the graph (for vertical axes) or the height (for horizontal axes). As a rough guide, the default is 0.01
textcolor Paint optional XML / Tag Library

Description

Set the color of the text
padding Integer[1..4] optional XML / Tag Library

Description

  • (for text) How much spacing to put around the text
  • (when used on an "axesgraph" or "piegraph" tag in the Tag Library only) how much spacing to put arund the graph as a whole
  • (when used on a "key") how much spacing to put inside the key around the interior items.
Padding is specified as in CSS - a single value can be used to specify the padding on all sides; two values specify top/bottom and left/right, three values specify top, bottom and left/right, and four values specify top, right, bottom and left.
paddingleft Integer optional XML / Tag Library

Description

Specify left padding only.
paddingright Integer optional XML / Tag Library

Description

Specify right padding only.
paddingbottom Integer optional XML / Tag Library

Description

Specify bottom padding only.
paddingtop Integer optional XML / Tag Library

Description

Specify top padding only.
fontsize Real > 0 optional XML / Tag Library

Description

The size of the text in points

See Also

font String optional XML / Tag Library

Description

The font to use. This attribute is combination of the "fontsize", "fontweight", "fontstyle" and "fontfamily" attributes, in the same vein as the CSS2 "font" attribute. For instance, font="12pt bold Times" is the same as fontfamily="Times" fontweight="bold" fontsize="12pt".

See Also

fontfamily String optional XML / Tag Library

Description

The family (face) of the text to use. The exact meaning of this depends on the type of format used. For SVG graphs, where fonts are not embedded, this can be any string at all - it is the SVG viewers responsibility to choose an appropriate font. For PNG graphs created from the Tag library, the font name may either match a name specified by a font tag, or it will be passed in to the Font constructor. The default value is "Default", which maps to a sans-serif font.

Examples

Example: Using a system font
<bfg:axesgraph>
  <label fontfamily="serif">My Label</label>
  ...
</bfg:axesgraph>
Example: Embedding a truetype font using the Tag library
<bfg:font name="myfont" src="http://localhost/myfont.ttf" />
<bfg:axesgraph>
  <label fontfamily="myfont">My Label</label>
  ...
</bfg:axesgraph>

See Also

fontweight normal | bold optional XML / Tag Library

Description

The weight of the text. If not specified the default is "normal"

See Also

fontstyle normal | italic optional XML / Tag Library

Description

The style of the text. If not specified the default is "normal"

See Also

align box? (top | middle | bottom) (left | center | right) optional XML / Tag Library

Description

How to align the text relative to its "control point". The "align" value is one or two words, specifying a horizontal alignment, vertical alignment or both. For example, to specify just a horizontal alignment do align="center" (the vertical alignment is undefined). To align horizontally and vertically, do align="center middle". As in HTML, "middle" refers to vertical alignment and "center" refers to horizontal. The special value "box" can be used in an <axes> to require all the items in the axis are aligned as a group, rather than individually.
rotate Real optional XML / Tag Library

Description

How far to rotate the text or marker from its normal position, in degrees clockwise from 12 o'clock. For labels on piegraphs the special value "auto" may be used to rotate labels to match the orientation of their slices.
color Paint optional XML / Tag Library

Description

The paint to use as the fill color for the specified object
bordercolor Color optional XML / Tag Library

Description

The color to use as the border color for the specified object. May be "none" to not draw a border for this object.
linethickness Real > 0 optional XML / Tag Library

Description

The thickness to draw the borders for this object, except for lineseries and functionseries objects when the graph is being drawn in 2D, in which case this attribute, as you would expect, sets the thickness of the lines.
dash Real[] optional XML / Tag Library

Description

The dashing pattern to use to draw the borders for this object (for 2D lineseries this functions the same as the linethickness attribute). An even number of parameters that are > 0 must be specified, where the first in each pair is the length of the dash, the second is the length of the space. Examples would be dash="5,5" to create a regular dash pattern, or dash="6,2,2,2" to create a dash/dot type pattern.
Big Faceless Graph Library 2.3 Tag Documentation - Copyright © 2006 Big Faceless Organization