|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.plot.ScatterPlot
public class ScatterPlot
A simple plot utility for generating scatter plots without the need to delve deep into the JFreePlot package. Note! This class is experimental and it is likely that the implementation will change in the future.
Field Summary | |
---|---|
private XYSeriesCollection |
allSeries
|
private JFreeChart |
chart
|
private XYPlot |
plot
|
Constructor Summary | |
---|---|
ScatterPlot(String nameX,
String nameY)
Create a new ScatterPlot. |
Method Summary | |
---|---|
void |
addData(SqlResultIterator data,
Collection<PlotAnnotation> annotations)
Add data to the plot. |
void |
addData(SqlResultIterator data,
String... names)
Add data to the plot. |
JFreeChart |
getChart()
Get the underlying JFreeChar object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private XYPlot plot
private XYSeriesCollection allSeries
private JFreeChart chart
Constructor Detail |
---|
public ScatterPlot(String nameX, String nameY)
nameX
- The label on the X-axisnameY
- The label on the Y-axisMethod Detail |
---|
public void addData(SqlResultIterator data, String... names) throws SQLException
SqlResultIterator
should return
the x value as a float in the first position, ie. data.getFloat(1)
and y values in the positions 2 and up.
data
- The data to plotnames
- An array of series names, x-value for series 'i' is found
in data.getFloat(2+i)
SQLException
public void addData(SqlResultIterator data, Collection<PlotAnnotation> annotations) throws SQLException
The annotations collection contains the mappings from the actual value to
the annotation. Ie. if the result contains a 1 in the first column we
check which annotation returns a 1 in it's PlotAnnotation.getValues()
method. One value may not be used by more than one annotation.
data
- The data to plotannotations
- Annotation information that maps each data spot to
an annotation
SQLException
public JFreeChart getChart()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |