|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fusioncharts.Graph
public class Graph
The Graph class provides a graph that the ChartFactory can work with in order to output the appropriate string data value for the type of chart to display on the page. Originally this was a subclass of WePopChart.java but we decided that it was a better solution to separate it from the class. This will be the parent Graph class for all graphing type packages in the future. A set of methods that all graphs can use is included. 20090323 - First created by David Lai
Constructor Summary | |
---|---|
Graph(java.lang.String graphId,
ChartType graphType,
int length,
javax.servlet.http.HttpServletRequest request)
Constructor for a Graph object. |
Method Summary | |
---|---|
double |
calculateMax()
Calculates the maximum value of all the series in the graph. |
double |
calculateMin()
Calculates the minimum value of all the series in the graph. |
void |
clear()
Clears the Series objects from this Graph. |
java.lang.Object |
clone()
Creates and returns a copy of the graph object. |
int |
compareTo(Graph graph)
Compares the graphType enum with the specified object for order. |
Series |
createSeries(int index,
java.lang.String label)
Creates a Series for this graph. |
Series |
createSeries(java.lang.String label)
Creates a Series for this graph. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getCategory(int index)
Accessor method to get a graph category. |
java.lang.String |
getGraphId()
Accessor method to return the object identifier. |
ChartType |
getGraphType()
Accessor method to return the graph type |
int |
getHeight()
Accessor method to get height of graph |
static java.lang.String |
getMaxScale(double minValue,
double maxValue)
|
static java.lang.String |
getMinScale(double minValue,
double maxValue)
|
java.util.LinkedList<Series> |
getNonTrendLineSeries()
Retreives a linked list of series that are either bar, line or area type |
int |
getNumberOfCategories()
Returns the number of categories for this graph. |
int |
getNumberOfSeries()
Returns the current number of series. |
Series |
getSeries(int index)
Returns the Series at a specified index. |
java.util.LinkedList<Series> |
getTrendLineSeries()
Retreives a linked list of trendline series |
int |
getWidth()
Accessor method to get width of graph |
int |
hashCode()
Returns a hash code value for the object. |
void |
setCategory(int index,
java.lang.String category)
Manipulator method to set a graph category. |
void |
setCategory(java.lang.String... category)
Manipulator method to set the graph categories. |
void |
setHeight(int height)
Manipulator method to set the height of the graph. |
void |
setWidth(int width)
Manipulator method to set the width. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph(java.lang.String graphId, ChartType graphType, int length, javax.servlet.http.HttpServletRequest request) throws java.lang.IllegalArgumentException
graphId
- The graph name.graphType
- The graph type ie:(pie graph, column chart). From the chart type enumlength
- The length of the categories.request
- The user request. HTTP request header fields allow the client to
pass additional information about the request, and about the client
itself, to the server. These fields also act as request modifiers
by the responding script. For additional information on HTTP
Headers, consult the W3C
RFC2616
.
java.lang.IllegalArgumentException
- If the graph object name is blank or length is less than or
equal to zero.Method Detail |
---|
public ChartType getGraphType()
public java.lang.String getGraphId()
public void setCategory(java.lang.String... category)
categories
- The list of category labels.public void setCategory(int index, java.lang.String category)
index
- The index.category
- The category label.public java.lang.String getCategory(int index)
index
- The index.
public int getNumberOfCategories()
public Series getSeries(int index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
- If the indice specified is less than 0 or greater than or equal
to the number of series.public int getNumberOfSeries()
public Series createSeries(int index, java.lang.String label) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
index
- The index to insert the series at (first index is 0).label
- The series label.
java.lang.IndexOutOfBoundsException
- If the index specified is out of range.
java.lang.IllegalArgumentException
- If an invalid argument was passed.com.pointclickcare.charts.Series#Series(String, int)}
The Series constructor definition.
public Series createSeries(java.lang.String label) throws java.lang.IllegalArgumentException
label
- The series label.
java.lang.IllegalArgumentException
- If an invalid argument was passed.com.pointclickcare.charts.Series#Series(String, int)}
The Series constructor definition.
public int getHeight()
public void setHeight(int height)
height
- The height of the graphpublic int getWidth()
public void setWidth(int width)
width
- the width to set it topublic double calculateMin()
public double calculateMax()
public void clear()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- If the object's class does not support the Cloneable interface.
Subclasses that override the clone method can also throw this
exception to indicate that an instance cannot be cloned.java.lang.Cloneable}
public int compareTo(Graph graph)
compareTo
in interface java.lang.Comparable<Graph>
o
- The Object to be compared.
java.lang.ClassCastException
- If the specified object's type prevents it from being compared
to this Object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The reference object with which to compare.
public int hashCode()
hashCode
in class java.lang.Object
java.util.HashMap}
public java.util.LinkedList<Series> getTrendLineSeries()
public java.util.LinkedList<Series> getNonTrendLineSeries()
public static java.lang.String getMinScale(double minValue, double maxValue)
public static java.lang.String getMaxScale(double minValue, double maxValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |