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

label

Description

The "label" tag is used to add a text label to the graph. It's effect depends on it's location:

Examples

Example: Setting the title of a graph
<axesgraph width="300" height="300">
  <label>My First Graph</label>
  ...
</axesgraph>
Example: Setting the title of a key
<axesgraph width="300" height="300">
  ...
  <key>
    <label>My First Key</label>
  </key>
</axesgraph>
Example: Adding some labels to a series, and a label to an axis
<axesgraph width="300" height="300">
  <axis pos="bottom" type="date" density="sparse" rotate="45" align="left top">
    <label>Date</label>
  </axis>
  <axis pos="left" type="int"><label>Attendance</label></axis>
  <lineseries name="attendance">
    <data x="2004-12-18" y="137" />
    <data x="2004-12-25" y="12" />
    <data x="2005-01-01" y="18" />
    <data x="2005-01-08" y="180" />
    <label x="2004-12-25" y="22" rotate="-90" align="left middle">Xmas Day</label>
    <label x="2005-01-01" y="28" rotate="-90" align="left middle">NY Day</label>
  </lineseries>
</axesgraph>
Example: Setting the label on a slice of Pie, including percentages
<piegraph width="300" height="300">
  <data key="Apples" value="20"><label>Apples (0%%)</label></data>
  <data key="Oranges" value="20"><label>Oranges (0%%)</label></data>
</piegraph>

Attributes

x Real or Date optional XML / Tag Library

Description

When the label is inside a "series", this attribute is required and defines where to position it on the X axis.
y Real or Date optional XML / Tag Library

Description

When the label is inside a "series", this attribute is required and defines where to position it on the Y axis.
name String optional XML / Tag Library

Description

Every item in the graph may have a "name", which is how it appears in the Key (if listed) and for some items, how it's refered to in JavaScript. The name is required for Series and optional for other items like markers.
distance Real > 0 optional XML / Tag Library

Description

When the label is inside a "piegraph" or "dialgraph", how far from the slice to position the label. The value specifies a percentage of the radius of the pie or dial, eg "20" would place the label 20% further away from the center of the pie than the edge of the slice. If this value is zero (the default) the label is placed on the slice.
angle Real optional XML / Tag Library

Description

When the label is inside a "dialgraph", setting this parameter to the angle (in degrees clockwise from 12 o'clock) and the "distance" attribute will place the label on the dial.
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 (top | middle | bottom) (left | center | right) optional XML / Tag Library

Description

How to align the text relative to it's "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.
rotate Real optional XML / Tag Library

Description

How far to rotate the text or marker from it's 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.
href URI optional Tag Library Only

Description

Used in interactive graphs to turn a region of the graph into a hyperlink.
target frame-target optional Tag Library Only

Description

Used in interactive graphs to set the target of a href.
title Text optional Tag Library Only

Description

The "title" attribute of the image
onclick script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the click event occurs on a region of the graph
ondblclick script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the dblclick event occurs on a region of the graph
onkeydown script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the keydown event occurs on a region of the graph
onkeypress script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the keypress event occurs on a region of the graph
onkeyup script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the keyup event occurs on a region of the graph
onmousedown script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the mousedown event occurs on a region of the graph
onmousemove script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the mousemove event occurs on a region of the graph
onmouseout script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the mouseout event occurs on a region of the graph
onmouseover script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the mouseover event occurs on a region of the graph
onmouseup script optional Tag Library Only

Description

Used in interactive graphs to set what happens when the mouseup event occurs on a region of the graph
Big Faceless Graph Library 2.3 Tag Documentation - Copyright © 2006 Big Faceless Organization