Class MonkeyBoyGraph

java.lang.Object
  |
  +--MonkeyBoyGraph

public class MonkeyBoyGraph
extends java.lang.Object


Field Summary
 java.awt.Color axisDataLblColor
          Color of the graph's axis data labels.
 java.awt.Color axisLabelColor
          Color of the graph's axis labels.
 int axisLabelDataSize
          The size of the font for the axis data labels.
Default: 12
 int axisLabelSize
          The size of the font for the axis labels.
 java.lang.String axisLabelX
          The label for the X-axis - Default: None.
 java.lang.String axisLabelY
          The label for the Y-axis - Default: None.
 java.awt.Color axisLinesColor
          Color of the graph's axis lines.
 int axisOffsetX
          The number of pixel the actual graph is in from the left and right edge.
 int axisOffsetY
          The number of pixel the actual graph is in from the bottom and top.
 java.awt.Color bgColor
          Background color for the canvas.
 java.awt.Color dataColor
          Color of the graph's data.
 char[][] dataSetPie
          The data labels for the pie graph.
 int dataSets
          The number of datasets.
 long[] dataSetX
          The first data set.
 long[] dataSetY
          The second data set.
 java.awt.Color graphColor
          Color of the graph's background.
 java.lang.String graphTitle
          The title of the graph - Default: None.
 int graphType
          The graph type.
 boolean gridLines
          Gridlines flag.
 java.awt.Color gridLinesColor
          Color of the graph's gridlines.
 boolean plotDataPoints
          Plot Data Points flag.
 java.awt.Color titleColor
          Color of the graph's title.
 int titleSize
          The size of the title font - Default: 12
 int xTicks
          The number of tick marks for the X-axis
 int yTicks
          The number of tick marks for the Y-axis
 
Constructor Summary
MonkeyBoyGraph()
          Constructor in which sets the graph's size to the default 320x240 pixels
MonkeyBoyGraph(int graphWidth, int graphHeight)
          Constructor in which sets the graph's size to (graphWidth)x(graphHeight) pixels
 
Method Summary
 boolean createGraph(java.lang.String fileName)
          Actually creates the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphTitle

public java.lang.String graphTitle
The title of the graph - Default: None. Applies to all graphs.

titleSize

public int titleSize
The size of the title font - Default: 12

axisLabelX

public java.lang.String axisLabelX
The label for the X-axis - Default: None. Does not apply to pie graph.

axisLabelY

public java.lang.String axisLabelY
The label for the Y-axis - Default: None. Does not apply to pie graph.

axisLabelSize

public int axisLabelSize
The size of the font for the axis labels. Default: 12

dataSetPie

public char[][] dataSetPie
The data labels for the pie graph. Only used for the pie graph

dataSetX

public long[] dataSetX
The first data set. Used for the X-axis (or the data for the pie graph)

dataSetY

public long[] dataSetY
The second data set. Not used for the pie graph

dataSets

public int dataSets
The number of datasets. Default: 0

xTicks

public int xTicks
The number of tick marks for the X-axis

yTicks

public int yTicks
The number of tick marks for the Y-axis

axisOffsetX

public int axisOffsetX
The number of pixel the actual graph is in from the left and right edge. Default: 45 pixels. Change this number if your axis labels and axis data labels overlap.

axisOffsetY

public int axisOffsetY
The number of pixel the actual graph is in from the bottom and top. Default: 65 pixels. Change this number if your axis labels and axis data labels overlap.

axisLabelDataSize

public int axisLabelDataSize
The size of the font for the axis data labels.
Default: 12

graphType

public int graphType
The graph type. Default: 0
0 - Line Graph
1 - Scatterplot
2 - Bar Graph
3 - 3D Bar Graph
4 - Area Graph
5 - Pie Graph

plotDataPoints

public boolean plotDataPoints
Plot Data Points flag. Default: true.
If true the data points will be plotted as well as the graph chosen.

gridLines

public boolean gridLines
Gridlines flag. Default: true.

bgColor

public java.awt.Color bgColor
Background color for the canvas. Default: Color.white

graphColor

public java.awt.Color graphColor
Color of the graph's background. Default: Color.white

titleColor

public java.awt.Color titleColor
Color of the graph's title. Default: Color.black

axisLinesColor

public java.awt.Color axisLinesColor
Color of the graph's axis lines. Default: Color.red

axisLabelColor

public java.awt.Color axisLabelColor
Color of the graph's axis labels. Default: Color.black

axisDataLblColor

public java.awt.Color axisDataLblColor
Color of the graph's axis data labels. Default: Color.black

gridLinesColor

public java.awt.Color gridLinesColor
Color of the graph's gridlines. Default: Color.lightGray

dataColor

public java.awt.Color dataColor
Color of the graph's data. Default: Color.blue
Constructor Detail

MonkeyBoyGraph

public MonkeyBoyGraph()
Constructor in which sets the graph's size to the default 320x240 pixels

MonkeyBoyGraph

public MonkeyBoyGraph(int graphWidth,
                      int graphHeight)
Constructor in which sets the graph's size to (graphWidth)x(graphHeight) pixels
Method Detail

createGraph

public boolean createGraph(java.lang.String fileName)
Actually creates the graph. Set all properties before doing this.
Output is a jpeg file named filename
If all goes well it returns true - otherwise false.