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

key

Description

The "key" tag can be used to create a Key for the graph, describing its contents. At its simplest it is often enough to just add <key align="right"/> to the graph, and the key will be created with the name of each series (for Axes graphs) or slice (for Pie graphs). Alternatively the keyitem tag may be used to list each series individually.

Valid Children

label? keyitem*

Examples

Example: Create a key to the right of the graph with each series listed
<axesgraph width="300" height="300">
  <lineseries name="First data set">...</lineseries>
  <lineseries name="Second data set">...</lineseries>
  <lineseries name="Third data set">...</lineseries>
  <key align="right" />
</axesgraph>
Example: Create a key overlaying the graph, listing some of the series
<axesgraph width="300" height="300">
  <lineseries name="First data set">...</lineseries>
  <lineseries name="Second data set">...</lineseries>
  <lineseries name="Not listed in key">...</lineseries>
  <key x="0.8" y="0.1">
    <keyitem series="First data set" />
    <keyitem series="Second data set" />
  </key>
</axesgraph>

Attributes

x Real optional XML / Tag Library

Description

This attribute (along with "y") can be set to place the key over top of the body of the graph. the value ranges from 0 (to the left of the graph) to 1 (to the right).

Examples

Example: Place the key at the top left corner of the graph
<key x="0.2" y="0.8" />
y Real optional XML / Tag Library

Description

This attribute (along with "x") can be set to place the key over top of the body of the graph. the value ranges from 0 (to the bottom of the graph) to 1 (to the top).
align left | right | top | bottom optional XML / Tag Library

Description

This attribute can be set to align the key to the left, right, top or bottom of the graph. The key will be placed "outside" the graph - if you want it to overlap you can use the "x" and "y" attributes instead to place the key over the body of the graph.
margin Integer optional XML / Tag Library

Description

When the key is positioned using the "align" attribute, how much space to place between the key and the graph (in pixels). This value has no effect when "x" and "y" are used to position the key.
marginleft Integer optional XML / Tag Library

Description

Specify left margin only.
marginright Integer optional XML / Tag Library

Description

Specify right margin only.
margintop Integer optional XML / Tag Library

Description

Specify top margin only.
marginbottom Integer optional XML / Tag Library

Description

Specify bottom margin only.
padding Integer[1..4] optional XML / Tag Library

Description

Controls the interior padding between the edge of the key and its keyitem children. If one value is specified it will be used on all four sides, and if more than one they will be used in the same way as in CSS: 2 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.
paddingtop Integer optional XML / Tag Library

Description

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

Description

Specify bottom padding only.
boxratio Real > 0 optional XML / Tag Library

Description

Controls the size of the boxes drawn in the key. A value of 1 results in square boxes, 0.5 in rectangles twice as wide as they are high, and so on.
verticaladvance Integer > 0 optional XML / Tag Library

Description

Controls the distance between two successive lines of text in the key.
horizontaladvance Integer > 0 optional XML / Tag Library

Description

Controls the distance between two successive columns of text in the key.
maxwidth Real > 0 optional XML / Tag Library

Description

Controls the maximum width of the key. A value of 0 will cause the key to be drawn in one vertical column, which is the default for right or left aligned graphs.

Examples

Example: Cause the key to take 2/3 of the width of the graph itself
<piegraph width="300" height="400">
   ...
   <key maxwidth="200" align="bottom" />
</piegraph>
textcolor Paint optional XML / Tag Library

Description

Set the color of the text
color Color optional XML / Tag Library

Description

Set the color of the key box itself.
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.
textcolor Paint optional XML / Tag Library

Description

Set the color of the text
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

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