Package com.inet.report.chart.plot
Class XYPlot
- java.lang.Object
-
- com.inet.report.chart.plot.AbstractPlot
-
- com.inet.report.chart.plot.XYPlot
-
- All Implemented Interfaces:
ChartPlot
,java.io.Serializable
public class XYPlot extends AbstractPlot
A general class for plotting data in the form of (x, y) pairs. This plot can use data from any class that implements theXYDataset
interface.- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inet.report.chart.plot.AbstractPlot
AbstractPlot.GradientSetting
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_SIZE_COEFFICIENT
The default bubble size coefficient.static XYStyle
DEFAULT_STYLE
Default chart style with this plot.-
Fields inherited from class com.inet.report.chart.plot.AbstractPlot
DEFAULT_COLOR_SEQUENCE, DEFAULT_FOREGROUND_ALPHA, DEFAULT_ITEM_LABEL_COLOR, DEFAULT_ITEM_LABEL_FONT, DEFAULT_OUTLINE_COLOR, DEFAULT_OUTLINE_STYLE, DEFAULT_OUTLINE_WIDTH, TOKEN_PLOT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContinuousNumberAxis
getCategoryAxis()
Returns the category axis for this plot.ContinuousNumberAxis
getDataAxis()
Returns the data axis for this plot.XYDataset
getDataset()
Returns a dataset of typeXYDataset
.java.util.List
getReferencedObject()
double
getSizeCoefficient()
Returns the size coefficient of chart items.ChartStyle
getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.protected java.lang.StringBuilder
getSubProperties(int depth)
Returns the serialized simple properties of subclasses.void
readProperties(org.w3c.dom.Element element, Chart2 chart)
Reads the chart properties from the DOMParser Element.void
refreshAutoTitles(Chart2 chart)
Reads out the data column names from dataset and refreshes the chart labels.protected void
saveSubProperties(java.io.PrintWriter out, int depth)
Writes the intern properties to output.void
setCategoryAxis(ContinuousNumberAxis categoryAxis)
Sets the category axis for this plot.void
setDataAxis(ContinuousNumberAxis dataAxis)
Sets the data axis for this plot.void
setDataset(XYDataset dataset)
Sets the dataset for this plot.void
setSizeCoefficient(double sizeCoefficient)
Sets the size coefficient of the bubbles.void
setStyle(XYStyle style)
Sets the chart style of this plot.-
Methods inherited from class com.inet.report.chart.plot.AbstractPlot
getBackColor, getColorFormula, getColorSequence, getForegroundAlpha, getGradientSetting, getItemLabelColor, getItemLabelFont, getItemLabelFormat, getItemLabelFormatFormula, getItemShape, getOutlineColor, getOutlineStyle, getOutlineWidth, isColorBySeries, isDrawOutline, isSameColorsForSameGroups, isShowLabel, isShowValue, saveProperties, setBackColor, setColorBySeries, setColorFormula, setColorSequence, setDrawOutline, setForegroundAlpha, setGradientSetting, setItemLabelColor, setItemLabelFont, setItemLabelFormat, setItemLabelFormatFormula, setItemShape, setOutlineColor, setOutlineStyle, setOutlineWidth, setSameColorsForSameGroups, setShowLabel, setShowValue
-
-
-
-
Field Detail
-
DEFAULT_STYLE
public static final XYStyle DEFAULT_STYLE
Default chart style with this plot.
-
DEFAULT_SIZE_COEFFICIENT
public static final double DEFAULT_SIZE_COEFFICIENT
The default bubble size coefficient.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDataset
public XYDataset getDataset()
Returns a dataset of typeXYDataset
.- Returns:
- the dataset
- Since:
- 8.0
- See Also:
setDataset(XYDataset)
,XYForAllRecordsDataset
,XYForEachRecordDataset
,XYOneGroupDataset
-
setDataset
public void setDataset(XYDataset dataset)
Sets the dataset for this plot.- Parameters:
dataset
- the dataset to set (null
not permitted),- Since:
- 8.0
- See Also:
getDataset()
,XYDataset
,XYForAllRecordsDataset
,XYForEachRecordDataset
,XYOneGroupDataset
-
getCategoryAxis
public ContinuousNumberAxis getCategoryAxis()
Returns the category axis for this plot.- Returns:
- the categoryAxis
- Since:
- 8.0
- See Also:
setCategoryAxis(ContinuousNumberAxis)
,ContinuousNumberAxis
-
setCategoryAxis
public void setCategoryAxis(ContinuousNumberAxis categoryAxis)
Sets the category axis for this plot.- Parameters:
categoryAxis
- the category axis (null
not permitted)- Since:
- 8.0
- See Also:
getCategoryAxis()
,ContinuousNumberAxis
-
getDataAxis
public ContinuousNumberAxis getDataAxis()
Returns the data axis for this plot.- Returns:
- the dataAxis
- Since:
- 8.0
- See Also:
setDataAxis(ContinuousNumberAxis)
,ContinuousNumberAxis
-
setDataAxis
public void setDataAxis(ContinuousNumberAxis dataAxis)
Sets the data axis for this plot.- Parameters:
dataAxis
- the data axis (null
not permitted)- Since:
- 8.0
- See Also:
getDataAxis()
,ContinuousNumberAxis
-
getStyle
public ChartStyle getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.- Specified by:
getStyle
in classAbstractPlot
- Returns:
- the style
- See Also:
BarStyle.BAR2D
,LineStyle.LINE_MARKER
,AreaStyle.AREA2D_STACKED
-
setStyle
public void setStyle(XYStyle style)
Sets the chart style of this plot.- Parameters:
style
- the style (null
not permitted)- Since:
- 8.0
- See Also:
getStyle()
,XYStyle
-
getSizeCoefficient
public double getSizeCoefficient()
Returns the size coefficient of chart items. The value is expressed as a coefficient of the available range.- Returns:
- the coefficient.
- Since:
- 8.0
- See Also:
setSizeCoefficient(double)
-
setSizeCoefficient
public void setSizeCoefficient(double sizeCoefficient)
Sets the size coefficient of the bubbles. The value is expressed as a coefficient of the available range. Allowed value are between 0 and 1. This property works only with the chart typeXYStyle.BUBBLE
. To set the shape size of scatter chart please use thisAbstractPlot.setItemShape(ItemShape)
.- Parameters:
sizeCoefficient
- the coefficient- Throws:
java.lang.IllegalArgumentException
- if the coefficient is out of range.- Since:
- 8.0
- See Also:
getSizeCoefficient()
,DEFAULT_SIZE_COEFFICIENT
-
refreshAutoTitles
public void refreshAutoTitles(Chart2 chart)
Reads out the data column names from dataset and refreshes the chart labels. Please use this function to refresh the chart labels if the data was be changed.- Specified by:
refreshAutoTitles
in interfaceChartPlot
- Specified by:
refreshAutoTitles
in classAbstractPlot
- Parameters:
chart
- the chart
-
getSubProperties
protected java.lang.StringBuilder getSubProperties(int depth)
Returns the serialized simple properties of subclasses.- Overrides:
getSubProperties
in classAbstractPlot
- Parameters:
depth
- the depth of XML indent- Returns:
- the properties.
-
saveSubProperties
protected void saveSubProperties(java.io.PrintWriter out, int depth)
Writes the intern properties to output. Overwrites this to save intern properties direct toPrintWriter
without building aStringBuilder
.- Overrides:
saveSubProperties
in classAbstractPlot
- Parameters:
out
- the outputdepth
- the depth of XML indent
-
readProperties
public void readProperties(org.w3c.dom.Element element, Chart2 chart)
Reads the chart properties from the DOMParser Element.- Specified by:
readProperties
in interfaceChartPlot
- Overrides:
readProperties
in classAbstractPlot
- Parameters:
element
- the DOMParser Elementchart
- the chart
-
getReferencedObject
public java.util.List getReferencedObject()
- Specified by:
getReferencedObject
in interfaceChartPlot
- Overrides:
getReferencedObject
in classAbstractPlot
- Returns:
- the list of objects.
-
-