Package org.jCharts.chartData
Class ScatterPlotDataSet
- java.lang.Object
-
- org.jCharts.chartData.ScatterPlotDataSet
-
- All Implemented Interfaces:
java.io.Serializable,IAxisPlotDataSet,IData,IDataSet,IScatterPlotDataSet,HTMLTestable
public class ScatterPlotDataSet extends java.lang.Object implements IScatterPlotDataSet, HTMLTestable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayListdataprivate java.util.ArrayListlegendLabelsprivate intnumDataItemsprivate java.util.ArrayListpaintsprivate static java.awt.geom.Point2D.DoublePOINTprivate ScatterPlotPropertiesscatterPlotProperties
-
Constructor Summary
Constructors Constructor Description ScatterPlotDataSet(ScatterPlotProperties scatterPlotProperties)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDataPoints(java.awt.geom.Point2D.Double[] points, java.awt.Paint paint, java.lang.String legendLabel)static java.awt.geom.Point2D.DoublecreatePoint2DDouble()Take advantage of the face Cloning performs better than creating new for highly used Objects.ChartTypegetChartType()Returns the type constant that this data set should be plotted as.ChartTypePropertiesgetChartTypeProperties()Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.java.lang.StringgetLegendLabel(int index)Returns the legend label for the passed index.intgetNumberOfDataItems()Returns the number of elements in the data set.intgetNumberOfDataSets()Returns the number of elements in the data set.intgetNumberOfLegendLabels()Returns the number of Legend Labels to display.java.awt.PaintgetPaint(int index)Returns the legend label for the passed index.java.awt.geom.Point2D.DoublegetValue(int dataset, int index)Returns the value in the data set at the specified position.voidtoHTML(HTMLGenerator htmlGenerator)Enables the testing routines to display the contents of this Object.voidvalidate()Performs a limited validation of data.
-
-
-
Field Detail
-
POINT
private static java.awt.geom.Point2D.Double POINT
-
data
private java.util.ArrayList data
-
legendLabels
private java.util.ArrayList legendLabels
-
paints
private java.util.ArrayList paints
-
scatterPlotProperties
private ScatterPlotProperties scatterPlotProperties
-
numDataItems
private int numDataItems
-
-
Constructor Detail
-
ScatterPlotDataSet
public ScatterPlotDataSet(ScatterPlotProperties scatterPlotProperties)
Constructor- Parameters:
scatterPlotProperties-
-
-
Method Detail
-
getChartType
public final ChartType getChartType()
Returns the type constant that this data set should be plotted as.- Specified by:
getChartTypein interfaceIAxisPlotDataSet- Returns:
- ChartType
- See Also:
ChartType
-
addDataPoints
public void addDataPoints(java.awt.geom.Point2D.Double[] points, java.awt.Paint paint, java.lang.String legendLabel)- Parameters:
points-paint-legendLabel-
-
validate
public void validate() throws ChartDataExceptionPerforms a limited validation of data.- Specified by:
validatein interfaceIAxisPlotDataSet- Throws:
ChartDataException
-
getValue
public java.awt.geom.Point2D.Double getValue(int dataset, int index)Returns the value in the data set at the specified position.- Specified by:
getValuein interfaceIScatterPlotDataSet- Parameters:
dataset-index-- Returns:
- Point.Double
-
getLegendLabel
public final java.lang.String getLegendLabel(int index)
Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.- Specified by:
getLegendLabelin interfaceIDataSet- Parameters:
index-- Returns:
- String
-
getNumberOfLegendLabels
public int getNumberOfLegendLabels()
Returns the number of Legend Labels to display. This may not be the same as the number of Data Items, as in AxisCharts, or Data Sets, as in Pie Charts.- Specified by:
getNumberOfLegendLabelsin interfaceIDataSet- Returns:
- int
-
getPaint
public java.awt.Paint getPaint(int index)
Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.
-
getChartTypeProperties
public ChartTypeProperties getChartTypeProperties()
Description copied from interface:IDataSetReturns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.- Specified by:
getChartTypePropertiesin interfaceIDataSet- Returns:
- ChartTypeProperties
-
getNumberOfDataSets
public int getNumberOfDataSets()
Returns the number of elements in the data set.- Specified by:
getNumberOfDataSetsin interfaceIAxisPlotDataSet- Returns:
- int
-
getNumberOfDataItems
public int getNumberOfDataItems()
Returns the number of elements in the data set.- Specified by:
getNumberOfDataItemsin interfaceIDataSet- Returns:
- int
-
createPoint2DDouble
public static final java.awt.geom.Point2D.Double createPoint2DDouble()
Take advantage of the face Cloning performs better than creating new for highly used Objects.- Returns:
- Point2D.Double
-
toHTML
public void toHTML(HTMLGenerator htmlGenerator)
Enables the testing routines to display the contents of this Object.- Specified by:
toHTMLin interfaceHTMLTestable- Parameters:
htmlGenerator-
-
-