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
,Serializable
A general class for plotting data in the form of (x, y) pairs. This plot can
use data from any class that implements the
XYDataset
interface.- Since:
- 8.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inet.report.chart.plot.AbstractPlot
AbstractPlot.GradientSetting
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
The default bubble size coefficient.static final XYStyle
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the category axis for this plot.Returns the data axis for this plot.Returns a dataset of typeXYDataset
.double
Returns the size coefficient of chart items.getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.protected StringBuilder
getSubProperties
(int depth) Returns the serialized simple properties of subclasses.void
readProperties
(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
(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
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 Details
-
DEFAULT_STYLE
Default chart style with this plot. -
DEFAULT_SIZE_COEFFICIENT
public static final double DEFAULT_SIZE_COEFFICIENTThe default bubble size coefficient.- See Also:
-
-
Constructor Details
-
XYPlot
public XYPlot()Creates a xy plot (e.g. scatter or bubble) with default properties.- Since:
- 8.0
-
XYPlot
Creates a xy plot (e.g. scatter or bubble) with defined chart style. Initializes all properties with default values.- Parameters:
style
- the chart style (null
not permitted)- Since:
- 8.0
- See Also:
-
-
Method Details
-
getDataset
Returns a dataset of typeXYDataset
.- Returns:
- the dataset
- Since:
- 8.0
- See Also:
-
setDataset
Sets the dataset for this plot.- Parameters:
dataset
- the dataset to set (null
not permitted),- Since:
- 8.0
- See Also:
-
getCategoryAxis
Returns the category axis for this plot.- Returns:
- the categoryAxis
- Since:
- 8.0
- See Also:
-
setCategoryAxis
Sets the category axis for this plot.- Parameters:
categoryAxis
- the category axis (null
not permitted)- Since:
- 8.0
- See Also:
-
getDataAxis
Returns the data axis for this plot.- Returns:
- the dataAxis
- Since:
- 8.0
- See Also:
-
setDataAxis
Sets the data axis for this plot.- Parameters:
dataAxis
- the data axis (null
not permitted)- Since:
- 8.0
- See Also:
-
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:
-
setStyle
Sets the chart style of this plot.- Parameters:
style
- the style (null
not permitted)- Since:
- 8.0
- See Also:
-
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
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:
IllegalArgumentException
- if the coefficient is out of range.- Since:
- 8.0
- See Also:
-
refreshAutoTitles
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
Returns the serialized simple properties of subclasses.- Overrides:
getSubProperties
in classAbstractPlot
- Parameters:
depth
- the depth of XML indent- Returns:
- the properties.
-
saveSubProperties
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
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
- Specified by:
getReferencedObject
in interfaceChartPlot
- Overrides:
getReferencedObject
in classAbstractPlot
- Returns:
- the list of objects.
-