org.mov.chart.graph
Class BarGraph
java.lang.Object
org.mov.chart.graph.AbstractGraph
org.mov.chart.graph.BarGraph
- All Implemented Interfaces:
- Graph
public class BarGraph
- extends AbstractGraph
Horizontal bar graph. This graph is most commonly used to draw
the volume graph.
- Author:
- Andrew Leppard
Constructor Summary |
BarGraph(GraphSource source,
java.lang.String name,
boolean isPrimary)
Create a new horizontal bar graph. |
Method Summary |
java.lang.String |
getName()
Return the name of this graph. |
boolean |
isPrimary()
Return whether the graph is a primary graph. |
void |
render(java.awt.Graphics g,
java.awt.Color colour,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double bottomLineValue,
java.util.List xRange)
Draw the graph. |
Methods inherited from class org.mov.chart.graph.AbstractGraph |
getAcceptableMajorDeltas, getAcceptableMinorDeltas, getEndX, getHighestY, getLowestY, getSettings, getSource, getSourceName, getStartX, getToolTipText, getUI, getXRange, getY, getYLabel, setSettings |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BarGraph
public BarGraph(GraphSource source,
java.lang.String name,
boolean isPrimary)
- Create a new horizontal bar graph.
- Parameters:
source
- the source to rendername
- the graph nameisPrimary
- is this a primary graph?
render
public void render(java.awt.Graphics g,
java.awt.Color colour,
int xoffset,
int yoffset,
double horizontalScale,
double verticalScale,
double bottomLineValue,
java.util.List xRange)
- Description copied from interface:
Graph
- Draw the graph.
- Parameters:
g
- the Graphics object to render tocolour
- the colour the graph should be rendered in; override
this if the graph should be drawn in
a certain colour - such as a Moving Average graphxoffset
- the x offset in the graphics object where the graph
startsyoffset
- the y offset in the graphics object where the graph
startshorizontalScale
- horizontal scale factor; use this to convert
between X value in the xRange
to a
cartesian coordinate xverticalScale
- vertical scale factor; use this to convert
between Y value to a cartesian coordinate ybottomLineValue
- the Y value of the lowest line in the graphxRange
- a List
of Comparable
that contain the X values to plot
getName
public java.lang.String getName()
- Return the name of this graph.
- Returns:
- the name given to the constructor
isPrimary
public boolean isPrimary()
- Description copied from interface:
Graph
- Return whether the graph is a primary graph. Primary
graphs will appear together in the top chart. Secondary
graphs appear in their own charts which are added below.
The day close graph is primary; while the day close graph is
secondary.
- Returns:
true
if the graph is a primary graph