org.faceless.graph
Class AbstractLineGraph

java.lang.Object
  extended by org.faceless.graph.Graph
      extended by org.faceless.graph.AxesGraph
          extended by org.faceless.graph.AbstractLineGraph
Direct Known Subclasses:
AreaGraph, LineGraph

public abstract class AbstractLineGraph
extends AxesGraph

The abstract superclass for all graphs plotting continuous data (as opposed to bar graphs, which are for plotting discrete data). Unlike Pie Graphs and Bar Graphs, Line Graphs plot a Curve, which covers everything from a set of X and Y values (a DataCurve) to complex mathematical functions.

Several curves can be plotted on the same graph, for example to compare a set of readings with a theoretical curve.


Field Summary
 
Fields inherited from class org.faceless.graph.Graph
KEY_BOXED_BOTTOM, KEY_BOXED_LEFT, KEY_BOXED_RIGHT, KEY_BOXED_TOP, KEY_NONE
 
Method Summary
 void optionCurveDepth(double val)
          The depth "into the screen" of a curve.
 void optionFunctionSmoothness(double val)
          If you're plotting a FunctionCurve, how many steps to divide the curve into.
 void optionMaxDataPoints(int val)
          If you're plotting a DataCurve, the maximum number of values to plot.
 void optionMaxX(double val)
          The maximum value to plot on the X axis.
 void optionMinX(double val)
          The minimum value to plot on the X axis.
 void setCurve(String name, Curve curve)
          Add a Curve to the graph in the next default color.
 void setCurve(String name, Curve curve, Color color)
          Add a Curve to the graph in the specified color.
 
Methods inherited from class org.faceless.graph.AxesGraph
optionAxisStyle, optionBoxColor, optionFloorStyle, optionMaxY, optionMinY, optionXAxisAtZero, optionXAxisLabel, optionXAxisLabelStyle, optionXAxisStyle, optionXAxisTextRotation, optionXFormatter, optionXStretchToZero, optionYAxisAtZero, optionYAxisLabel, optionYAxisLabelStyle, optionYAxisStyle, optionYAxisTextRotation, optionYFormatter, optionYStretchToZero, optionYWallStyle, optionZAxisStyle, optionZFormatter, optionZWallStyle
 
Methods inherited from class org.faceless.graph.Graph
getDefaultBorderColor, getFontScale, optionDisplayKey, optionFixedAspectRatio, optionKeyBoxStyle, optionKeyStyle, optionSubTitle, optionSubTitleStyle, optionTitle, optionTitleStyle, optionXRotation, optionYRotation, optionZRotation, setDefaultBorderColor, setDefaultColors, setDefaultLineThickness, setFontScale, setLicenseKey, setLightLevel, setLightVector, setPieEdgeDegrees, toCanvas
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCurve

public void setCurve(String name,
                     Curve curve,
                     Color color)
Add a Curve to the graph in the specified color. If a curve with this name already exists it will be replaced.

Parameters:
name - the name to give this curve
curve - the curve to add
color - the color to plot this curve in

setCurve

public void setCurve(String name,
                     Curve curve)
Add a Curve to the graph in the next default color. If a curve with this name already exists it will be replaced.

Parameters:
name - the name to give this curve
curve - the curve to add

optionMinX

public void optionMinX(double val)
The minimum value to plot on the X axis. This is only a recommendation - if you're plotting one or more DataCurve, the actual minimum will be the lesser of this value and the lowest value in the curve. For graphs plotting only one or more FunctionCurve, this value is mandatory.

Default: data-driven


optionMaxX

public void optionMaxX(double val)
The maximum value to plot on the X axis.

Default: data-driven


optionFunctionSmoothness

public void optionFunctionSmoothness(double val)
If you're plotting a FunctionCurve, how many steps to divide the curve into. Higher numbers give smoother curves, but slower rendering times.

Default: 30


optionMaxDataPoints

public void optionMaxDataPoints(int val)
If you're plotting a DataCurve, the maximum number of values to plot. If your data set has thousands of values, you may set this and drop a few to speed things up (exactly which points are dropped are undefined, but the remaning data is guaranteed to be evenly spread across the graph).

Default: 100


optionCurveDepth

public void optionCurveDepth(double val)
The depth "into the screen" of a curve. Higher values give thicker curves.

Default: 1



Copyright © 2001-2012 Big Faceless Organization