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

functionseries

Description

The "functionseries" tag creates a line series whose Y values are calculated by a mathematical function, rather than by samples (as with a lineseries. The "constructor" or "method" tag may be used to specify the class or method that will return those values. If the "method" tag is used, the "min" and "max" values must be specified to determine the range of the function.

Valid Children

marker* label* line*

Examples

Example: Plotting a Sine and a Cosine
<axesgraph width="300" height="300">
  <axis pos="left" type="float" zerointersection="true" />
  <axis pos="bottom" type="float" zerointersection="true" />
  <functionseries name="Sine" method="java.lang.Math.sin" min="-3.14" max="3.14" />
  <functionseries name="CoSine" method="java.lang.Math.cos" min="-3.14" max="3.14" />
</axesgraph>

See Also

Attributes

depth Real > 0 optional XML / Tag Library

Description

How deep to draw the lines into the graph, when drawing in 3D. The value is specified as a proportion of the width of the graph, and the default is 0.1 (or 10%) of the width.
constructor Constructor optional XML / Tag Library

Description

This attribute can be used in place of "method" to specify a class which extends org.faceless.graph2.FunctionLineSeries, which will be used to determine the value of the function. The constructor may take doubles, floats, ints, booleans, chars or Strings - so some example values for this attribute would be com.yourcompany.YourClass(12, My String Here). or perhaps simple com.yourcompany.YourClass().
method Method name optional XML / Tag Library

Description

This attribute can be used in place of "constructor" to specify the name of a method to be executed to return the values to plot. The method must be public, static, not abstract, throw no Exceptions, take a single double as an argument and return a single double. The full package name must be specified, eg. java.lang.Math.sin.
min Real optional XML / Tag Library

Description

A mandatory attribute when "method" is used instead of "constructor", this values determines the minimum range of the function.
max Real optional XML / Tag Library

Description

A mandatory attribute when "method" is used instead of "constructor", this values determines the maximum range of the function.
series Series name optional XML / Tag Library

Description

If specified this can be used to wrap a previously defined series in a spline. It can be used as an alternative to repeating the X and Y values.

Examples

Example: Plotting data and a trend line
<axesgraph width="300" height="300">
  <axis pos="bottom" type="date" density="sparse" />
  <lineseries name="Samples">
    <data x="2004-01-01" y="5" />
    <data x="2004-01-02" y="7" />
    <data x="2004-01-03" y="12" />
  </lineseries>
  <splineseries name="Trend" spline="b" series="Samples" />
</axesgraph>
name String mandatory 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.
pos (top | bottom) (left | right) optional XML / Tag Library

Description

Which axes to plot the series against on an AxesGraph. This attribute has a default value of "bottom left", which means the series is plotted against the bottom and left axis, but other valid values would be "top left", "bottom right" or "top right".

Examples

Example: Plotting dates against the bottom axis and days of week against the top
<axesgraph width="300" height="300">
  <axis pos="bottom" type="date">
    <teeth rotate="90" align="left middle" />
  </axis>
  <axis pos="top" type="bar" />
  <lineseries pos="bottom left" name="Amount over the year">
    <data x="2003-01-01" y="20" />
    ...
    <data x="2003-12-31" y="17" />
  </lineseries>
  <barseries pos="top left" name="Average amount per weekday">
    <data x="Sun" y="18" />
    ...
    <data x="Sat" y="21" />
  </barseries>
</axesgraph>
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.
overflow Boolean optional XML / Tag Library

Description

If overflow is set to true, the item which it refers to will not play a part in the sizing algorithm used to ensure the graph fits the image: the item may overflow the edge of the graph. This makes sense only in a few situations, eg markers, lines and sometimes text, and should be used with caution.
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