schmitzm.jfree.chart.style
Class ScatterChartStyle

java.lang.Object
  extended by schmitzm.jfree.chart.style.AbstractChartStyle
      extended by schmitzm.jfree.chart.style.ScatterChartStyle
All Implemented Interfaces:
ChartStyle
Direct Known Subclasses:
FeatureScatterChartStyle

public class ScatterChartStyle
extends AbstractChartStyle

This class provides a chart style for scatter chart, which shows the data as points. Besides the points it is possible to show a regression line ("line of best fit") for the data points.

Author:
Martin Schmitz

Field Summary
protected  boolean regrLineVisible
          Stores whether a regression line ("line of best fit") for the data points is shown.
 
Fields inherited from class schmitzm.jfree.chart.style.AbstractChartStyle
axisStyle, bgPaint, borderVisible, descStyle, id, legend, LOGGER, maxRendererDatasetIdx, orientation, plotStyle, rendererStyle, TIPGEN_CAT, TIPGEN_XY, titleStyle, tooltips, type, URLGEN_CAT, URLGEN_XY, urls
 
Fields inherited from interface schmitzm.jfree.chart.style.ChartStyle
DOMAIN_AXIS, RANGE_AXIS, RANGE_AXIS2, X_AXIS, Y_AXIS, Y_AXIS_LEFT, Y_AXIS_RIGHT, Y_AXIS2
 
Constructor Summary
ScatterChartStyle(String id)
          Creates a scatter chart style a regression line shown.
 
Method Summary
 void applyToChart(JFreeChart chart)
          Applies the style to an existing chart.
 JFreeChart applyToDataset(Dataset dataset)
          Creates a scatter chart for the given Dataset and applies the style.
 boolean isRegressionLineVisible()
          Returns whether a regression line is shown.
 void setRegressionLineVisible(boolean visible)
          Sets whether a regression line is shown.
 
Methods inherited from class schmitzm.jfree.chart.style.AbstractChartStyle
getAxisCount, getAxisStyle, getBackground, getDescStyle, getID, getOrientation, getPlotStyle, getRendererCount, getRendererStyle, getTitleStyle, getType, hasLegend, hasTooltips, hasURLs, isBorderVisible, setAxisStyle, setBackground, setBorderVisible, setDescStyle, setLegend, setOrientation, setPlotStyle, setRendererStyle, setTitleStyle, setTooltips, setType, setURLs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regrLineVisible

protected boolean regrLineVisible
Stores whether a regression line ("line of best fit") for the data points is shown.

Constructor Detail

ScatterChartStyle

public ScatterChartStyle(String id)
Creates a scatter chart style a regression line shown.

Parameters:
id - a (unique) ID for the style
Method Detail

isRegressionLineVisible

public boolean isRegressionLineVisible()
Returns whether a regression line is shown.


setRegressionLineVisible

public void setRegressionLineVisible(boolean visible)
Sets whether a regression line is shown.


applyToDataset

public JFreeChart applyToDataset(Dataset dataset)
Creates a scatter chart for the given Dataset and applies the style.

Parameters:
dataset - the data for the chart
Throws:
UnsupportedOperationException - if the style can not be applied to the given dataset

applyToChart

public void applyToChart(JFreeChart chart)
Applies the style to an existing chart.

Specified by:
applyToChart in interface ChartStyle
Overrides:
applyToChart in class AbstractChartStyle
Parameters:
chart - chart the style is applied to
Throws:
UnsupportedOperationException - if the style can not be applied to the given dataset