i-net Clear Reports

com.inet.report.chart.plot
Class XYPlot

java.lang.Object
  extended by com.inet.report.chart.plot.AbstractPlot
      extended by 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 the XYDataset 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
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
 
Constructor Summary
XYPlot()
          Creates a xy plot (e.g. scatter or bubble) with default properties.
XYPlot(XYStyle style)
          Creates a xy plot (e.g. scatter or bubble) with defined chart style.
 
Method Summary
 ContinuousNumberAxis getCategoryAxis()
          Returns the category axis for this plot.
 ContinuousNumberAxis getDataAxis()
          Returns the data axis for this plot.
 XYDataset getDataset()
          Returns a dataset of type XYDataset.
 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.StringBuffer 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, getItemShape, getOutlineColor, getOutlineStyle, getOutlineWidth, getReferencedObject, isColorBySeries, isDrawOutline, isSameColorsForSameGroups, isShowLabel, isShowValue, saveProperties, setBackColor, setColorBySeries, setColorFormula, setColorSequence, setDrawOutline, setForegroundAlpha, setGradientSetting, setItemLabelColor, setItemLabelFont, setItemLabelFormat, 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
Constructor Detail

XYPlot

public XYPlot()
Creates a xy plot (e.g. scatter or bubble) with default properties.

Since:
8.0

XYPlot

public XYPlot(XYStyle style)
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:
XYStyle
Method Detail

getDataset

public XYDataset getDataset()
Returns a dataset of type XYDataset.

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 class AbstractPlot
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 type XYStyle.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 interface ChartPlot
Specified by:
refreshAutoTitles in class AbstractPlot
Parameters:
chart - the chart

getSubProperties

protected java.lang.StringBuffer getSubProperties(int depth)
Returns the serialized simple properties of subclasses.

Overrides:
getSubProperties in class AbstractPlot
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 to PrintWriter without building a StringBuffer.

Overrides:
saveSubProperties in class AbstractPlot
Parameters:
out - the output
depth - 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 interface ChartPlot
Overrides:
readProperties in class AbstractPlot
Parameters:
element - the DOMParser Element
chart - the chart

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH