Class AxesGraph
- java.lang.Object
-
- org.faceless.graph.Graph
-
- org.faceless.graph.AxesGraph
-
- Direct Known Subclasses:
AbstractBarGraph
,AbstractLineGraph
public abstract class AxesGraph extends Graph
An Axes Graph covers every Graph that is plotted against an Axes. Currently this is everything but the
PieGraph
.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
absolutemaxy
protected double
absoluteminy
protected java.lang.Double
axesmaxx
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected java.lang.Double
axesmaxy
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected java.lang.Double
axesmaxz
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected java.lang.Double
axesminx
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected java.lang.Double
axesminy
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected java.lang.Double
axesminz
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.protected Style
axesstyle
protected Style
boxstyle
protected org.faceless.graph.DataSet
data
The data array.protected Style
xaxeslabelstyle
protected Style
xaxestextstyle
protected boolean
xfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
protected Formatter
xformatter
Which formatter to use for the X, Y or Z axis.protected Style
xwallstyle
protected Style
yaxeslabelstyle
protected Style
yaxestextstyle
protected boolean
yfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
protected Formatter
yformatter
Which formatter to use for the X, Y or Z axis.protected Style
ywallstyle
protected Style
zaxestextstyle
protected boolean
zfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
protected Formatter
zformatter
Which formatter to use for the X, Y or Z axis.protected Style
zwallstyle
-
Fields inherited from class org.faceless.graph.Graph
canvas, key, KEY_BOXED_BOTTOM, KEY_BOXED_LEFT, KEY_BOXED_RIGHT, KEY_BOXED_TOP, KEY_NONE, keyboxstyle, keypadding, keystyle, keytype, subtitle, subtitlestyle, title, titlepadding, titlestyle, xrotation, yrotation, zrotation
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AxesGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
optionAxisStyle(Style val)
What style to draw the principal axes for the graph in.void
optionBoxColor(java.awt.Color val)
What color, if any, to draw the box around the content of the graph (excluding the values on the axes).void
optionFloorStyle(Style val)
What style, if any, to draw the grid on the floor of the graph (either where y=0 or y=min(y) - seeoptionXAxisAtZero
).void
optionMaxY(double val)
The maximum value to plot on the Y axis.void
optionMinY(double val)
The minimum value to plot on the Y axis.void
optionXAxisAtZero(boolean val)
If the Y-axis values go from -ve to +ve, whether to draw the X-Axis where y=0 or where y=min(y)void
optionXAxisLabel(java.lang.String val)
The label to give the X-Axisvoid
optionXAxisLabelStyle(Style val)
Set the style to write the label for the X-Axisvoid
optionXAxisStyle(Style val)
What Style to write the values on the X-Axisvoid
optionXAxisTextRotation(double val)
Whether to rotate the values on the Y-Axis.void
optionXFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the X axis.void
optionXStretchToZero(boolean val)
Whether to always stretch the X axis to include zero.void
optionYAxisAtZero(boolean val)
If the X-axis values go from -ve to +ve, whether to draw the Y-Axis where x=0 or where x=min(x)void
optionYAxisLabel(java.lang.String val)
The label to give the Y-Axisvoid
optionYAxisLabelStyle(Style val)
Set the style to write the label for the Y-Axisvoid
optionYAxisStyle(Style val)
What Style to write the values on the Y-Axisvoid
optionYAxisTextRotation(double val)
Whether to rotate the values on the X-Axis.void
optionYFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the Y axis.void
optionYStretchToZero(boolean val)
Whether to always stretch the Y axis to include zero.void
optionYWallStyle(Style val)
What style, if any, to draw the grid on the Y-Wall of the graph (either where x=0 or x=min(x) - seeoptionYAxisAtZero
).void
optionZAxisStyle(Style val)
What Style to write the values on the Z-Axisvoid
optionZFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the Z axis.void
optionZWallStyle(Style val)
What style, if any, to draw the grid on the back or Z-Wall of the graph.protected void
postcomplete()
PostComplete is called by a Graph when it's rendered, but after complete.protected void
postpostcomplete()
The unfortunately named PostPostComplete is called last of all by a Graph when it's rendered, to add anything that couldn't quite be laid out correctly on the last pass - usually Text dependant on the position of other text.protected void
prescalecomplete()
-
Methods inherited from class org.faceless.graph.Graph
addElement, complete, getDefaultBorderColor, getFontScale, optionDisplayKey, optionFixedAspectRatio, optionKeyBoxStyle, optionKeyStyle, optionRemoveBackFace, optionSubTitle, optionSubTitleStyle, optionTitle, optionTitleStyle, optionXRotation, optionYRotation, optionZRotation, setDefaultBorderColor, setDefaultColors, setDefaultLineThickness, setFontScale, setLicenseKey, setLightLevel, setLightVector, setPieEdgeDegrees, toCanvas
-
-
-
-
Field Detail
-
axesminx
protected java.lang.Double axesminx
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
axesmaxx
protected java.lang.Double axesmaxx
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
axesminy
protected java.lang.Double axesminy
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
axesmaxy
protected java.lang.Double axesmaxy
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
axesminz
protected java.lang.Double axesminz
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
axesmaxz
protected java.lang.Double axesmaxz
Subclasses of AxesGraph can set the min and max values of the axes if they think they know best, or leave them set to NULL to allow the AxesGraph superclass to take it's best guess.
-
absolutemaxy
protected double absolutemaxy
-
absoluteminy
protected double absoluteminy
-
data
protected org.faceless.graph.DataSet data
The data array.
-
axesstyle
protected Style axesstyle
-
zwallstyle
protected Style zwallstyle
-
ywallstyle
protected Style ywallstyle
-
xwallstyle
protected Style xwallstyle
-
yaxestextstyle
protected Style yaxestextstyle
-
xaxestextstyle
protected Style xaxestextstyle
-
zaxestextstyle
protected Style zaxestextstyle
-
xaxeslabelstyle
protected Style xaxeslabelstyle
-
yaxeslabelstyle
protected Style yaxeslabelstyle
-
boxstyle
protected Style boxstyle
-
zfloat
protected boolean zfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
-
yfloat
protected boolean yfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
-
xfloat
protected boolean xfloat
Whether the subclass feels that the X,Y or Z axis should be plotted using aFloatingPointFormatter
or anIntegerFormatter
-
xformatter
protected Formatter xformatter
Which formatter to use for the X, Y or Z axis.
-
yformatter
protected Formatter yformatter
Which formatter to use for the X, Y or Z axis.
-
zformatter
protected Formatter zformatter
Which formatter to use for the X, Y or Z axis.
-
-
Method Detail
-
optionXAxisLabel
public void optionXAxisLabel(java.lang.String val)
The label to give the X-AxisDefault: <none>
-
optionYAxisLabel
public void optionYAxisLabel(java.lang.String val)
The label to give the Y-AxisDefault: <none>
-
optionXAxisLabelStyle
public void optionXAxisLabelStyle(Style val)
Set the style to write the label for the X-AxisDefault: Black 12pt Helvetica
-
optionYAxisLabelStyle
public void optionYAxisLabelStyle(Style val)
Set the style to write the label for the Y-AxisDefault: Black 12pt Helvetica
-
optionXAxisAtZero
public void optionXAxisAtZero(boolean val)
If the Y-axis values go from -ve to +ve, whether to draw the X-Axis where y=0 or where y=min(y)Default: false except for the subclass
LineGraph
, which is true
-
optionYAxisAtZero
public void optionYAxisAtZero(boolean val)
If the X-axis values go from -ve to +ve, whether to draw the Y-Axis where x=0 or where x=min(x)Default: false except for the subclass
LineGraph
, which is true
-
optionXStretchToZero
public void optionXStretchToZero(boolean val)
Whether to always stretch the X axis to include zero. Some subclasses (e.g.AbstractBarGraph
) may not allow you to set this value.Default: usually false, but depends on subclass
-
optionYStretchToZero
public void optionYStretchToZero(boolean val)
Whether to always stretch the Y axis to include zero. Some subclasses (e.g.AbstractBarGraph
) may not allow you to set this value.Default: usually false, but depends on subclass
-
optionFloorStyle
public void optionFloorStyle(Style val)
What style, if any, to draw the grid on the floor of the graph (either where y=0 or y=min(y) - seeoptionXAxisAtZero
). You can set the color and border color, or just set the border color for a grid on an otherwise transparent wall.Default: null
-
optionYWallStyle
public void optionYWallStyle(Style val)
What style, if any, to draw the grid on the Y-Wall of the graph (either where x=0 or x=min(x) - seeoptionYAxisAtZero
). You can set the color and border color, or just set the border color for a grid on an otherwise transparent wall.Default: null
-
optionZWallStyle
public void optionZWallStyle(Style val)
What style, if any, to draw the grid on the back or Z-Wall of the graph. You can set the color and border color, or just set the border color for a grid on an otherwise transparent wall.Default: null
-
optionXAxisStyle
public void optionXAxisStyle(Style val)
What Style to write the values on the X-AxisDefault: Black 8pt Helvetica
-
optionYAxisStyle
public void optionYAxisStyle(Style val)
What Style to write the values on the Y-AxisDefault: Black 8pt Helvetica
-
optionZAxisStyle
public void optionZAxisStyle(Style val)
What Style to write the values on the Z-AxisDefault: Black 8pt Helvetica
-
optionYAxisTextRotation
public void optionYAxisTextRotation(double val)
Whether to rotate the values on the X-Axis. Likely values are 0 (horizontal), 90 (vertical) or anything inbetween. This can also be set directly in the style passed tooptionXAxisStyle
Default: 0
-
optionXAxisTextRotation
public void optionXAxisTextRotation(double val)
Whether to rotate the values on the Y-Axis. Likely values are 0 (horizontal), 90 (vertical) or anything inbetween. This can also be set directly in the style passed tooptionYAxisStyle
Default: 0
-
optionXFormatter
public void optionXFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the X axis. The default depends on the subclass and the data. To turn off the display of this axis, set tonew
NullFormatter
Default: data and class dependent
-
optionYFormatter
public void optionYFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the Y axis. The default depends on the subclass and the data. To turn off the display of this axis, set tonew
NullFormatter
Default: data and class dependent
-
optionZFormatter
public void optionZFormatter(Formatter val)
Which {link org.faceless.graph.formatter.Formatter} to use to format the values on the Z axis. The default depends on the subclass and the data. To turn off the display of this axis, set tonew
NullFormatter
Default: data and class dependent
-
optionAxisStyle
public void optionAxisStyle(Style val)
What style to draw the principal axes for the graph in.Default:
Style.getDefaultBorderColor()
-
optionBoxColor
public void optionBoxColor(java.awt.Color val)
What color, if any, to draw the box around the content of the graph (excluding the values on the axes). Set to null for no box.Default: null
-
optionMinY
public void optionMinY(double val)
The minimum value to plot on the Y axis. Set this to plot useful values for curves like tangents, that give infinite values at certain points, or to just plot the tops of Bar Graphs or Area Graphs.Note that if a data sample falls outside this value, that value will take precedence.
Default: -Infinity for Line Graphs, zero for Bar Graphs and Area Graphs
- Since:
- 1.0.5 for BarGraphs
-
optionMaxY
public void optionMaxY(double val)
The maximum value to plot on the Y axis. Set this to plot useful values for curves like tangents, that give infinite values at certain points, or extend the top of the graph beyond the maximum value of the data.Note that if a data sample falls outside this value, that value will take precedence.
Default: +Infinity
- Since:
- 1.0.5 for BarGraphs
-
postcomplete
protected void postcomplete()
Description copied from class:Graph
PostComplete is called by a Graph when it's rendered, but after complete. It should add any elements that are required but couldn't be calculated until afterGraph.complete()
(the axes in an axes graph are an example). The last thing it should do before returning is callsuper.postcomplete()
- Overrides:
postcomplete
in classGraph
-
prescalecomplete
protected void prescalecomplete()
-
postpostcomplete
protected void postpostcomplete()
Description copied from class:Graph
The unfortunately named PostPostComplete is called last of all by a Graph when it's rendered, to add anything that couldn't quite be laid out correctly on the last pass - usually Text dependant on the position of other text. The last thing it should do before returning is callsuper.postpostcomplete()
- Overrides:
postpostcomplete
in classGraph
-
-