lt.monarch.chart.spc
Class ScatterChart

java.lang.Object
  extended by lt.monarch.chart.AbstractView<PaintTags>
      extended by lt.monarch.chart.AbstractChart<PaintTags,GeneralProjector>
          extended by lt.monarch.chart.MultiSeriesChartBase<ChartPaintTags,Projector2D>
              extended by lt.monarch.chart.chart2D.Chart2D
                  extended by lt.monarch.chart.spc.SpcChart
                      extended by lt.monarch.chart.spc.ScatterChart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Chart<Projector2D>, ChartEntity, StyleEditorEntity, View

public class ScatterChart
extends SpcChart

Scatter chart. Displays relation between two parameters and a trend line. Values are calculated using formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.7.1.html

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  TextMarker correlationCoefficientMarker
           
protected  ChartDataModel scatterDataModel
           
protected  AbstractMarker scatterMarker
           
protected  LineSeries scatterSeries
           
protected  TextMarker trendEquationMarker
           
protected  ChartDataModel trendLineDataModel
           
protected  LineSeries trendLineSeries
           
protected  MathAxisMapper xMapper
           
protected  MathAxisMapper yMapper
           
 
Fields inherited from class lt.monarch.chart.spc.SpcChart
bottomAxis, dataModel, grid, leftAxis, rightAxis
 
Fields inherited from class lt.monarch.chart.chart2D.Chart2D
projector
 
Fields inherited from class lt.monarch.chart.AbstractChart
draftMode, locale, plugins
 
Fields inherited from class lt.monarch.chart.AbstractView
layoutInvalid, paintStyle, style
 
Constructor Summary
Constructor and Description
ScatterChart(ChartDataModel dataModel)
          Constructs scatter chart from the given data model
 
Method Summary
Modifier and Type Method and Description
 TextMarker getCorrelationCoefficientMarker()
          Returns correlation coefficient marker Use setVisible(false) to hide it.
 AbstractMarker getScatterMarker()
          Returns scatter points series marker.
 LineSeries getScatterSeries()
          Returns scatter points series.
 TextMarker getTrendEquationMarker()
          Returns trend equation marker Use setVisible(false) to hide it.
 LineSeries getTrendLineSeries()
          Returns trend equation line series.
 void setScatterMarker(AbstractMarker marker)
          Sets new marker for scatter series.
protected  void updateAxes(ScatterValuesCalculator calc)
          Updates chart axes.
protected  void updateChart()
          Redraws chart
protected  void updateCorrelationMarker(ScatterValuesCalculator calc, double minx, double maxx, double miny, double maxy)
          Updates correlation marker.
protected  void updateEquationMarker(ScatterValuesCalculator calc, double minx, double maxx, double miny, double maxy)
          Updates trend line marker.
protected  void updateGrid()
          Updates grid.
protected  void updateMappers(double minx, double miny, double maxx, double maxy)
          Updates chart mappers.
protected  void updateScatter(ScatterValuesCalculator calc)
          Updates scatter series.
protected  void updateTrendLine(ScatterValuesCalculator calc)
          Updates chart trend line.
 
Methods inherited from class lt.monarch.chart.spc.SpcChart
getBottomAxis, getDataModel, getGrid, getLeftAxis, getMax, getMax, getMin, getMin, getRightAxis, resetDataModel, setDataModel, setNoData, setNoData, trim
 
Methods inherited from class lt.monarch.chart.chart2D.Chart2D
addBottomXAxis, addLeftYAxis, addRightYAxis, addTopXAxis, addXAxis, addYAxis, dispose, finalize, getBreakLine, getChartAreaMargin, getMinAxisWidth, getProjector, getStackedXAxisMargin, getStackedYAxisMargin, getXAxes, getYAxes, layout, paintChart, projector, removeBottomXAxis, removeLeftYAxis, removeRightYAxis, removeTopXAxis, removeXAxis, removeYAxis, setBottomXAxis, setBreakLine, setChartAreaMargin, setLeftYAxis, setMinAxisWidth, setRightYAxis, setStackedBottomXAxisProportion, setStackedLeftYAxisProportion, setStackedRightYAxisProportion, setStackedTopXAxisProportion, setStackedXAxisMargin, setStackedXAxisProportion, setStackedYAxisMargin, setStackedYAxisProportion, setTopXAxis, setXAxis, setXAxis, setYAxis, setYAxis
 
Methods inherited from class lt.monarch.chart.MultiSeriesChartBase
activate, addObject, createLegendEntries, deactivate, findObject, getContainingObjects, getObjects, layoutObjects, removeObject, replaceObject, reset, setObjects, shiftObjects
 
Methods inherited from class lt.monarch.chart.AbstractChart
addPlugin, disableDrafMode, enableDraftMode, fillEntitySheet, getDescription, getLocale, getParentEntity, getPlugins, getShortDescription, invalidate, isDraftMode, paint, removePlugin, removePlugins, setDraftMode, setLocale
 
Methods inherited from class lt.monarch.chart.AbstractView
addViewListener, clone, container, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getPreferredSize, getSize, getSize, getStyle, getStyle, getWidth, getX, getY, isLayoutValid, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setPreferredSize, setSize, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.View
addViewListener, clone, container, getAlignmentX, getAlignmentY, getBounds, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPreferredSize, getSize, getSize, getStyle, getWidth, getX, getY, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPreferredSize, setSize, validate
 

Field Detail

yMapper

protected MathAxisMapper yMapper

xMapper

protected MathAxisMapper xMapper

trendLineDataModel

protected ChartDataModel trendLineDataModel

scatterDataModel

protected ChartDataModel scatterDataModel

scatterMarker

protected AbstractMarker scatterMarker

scatterSeries

protected LineSeries scatterSeries

trendLineSeries

protected LineSeries trendLineSeries

trendEquationMarker

protected TextMarker trendEquationMarker

correlationCoefficientMarker

protected TextMarker correlationCoefficientMarker
Constructor Detail

ScatterChart

public ScatterChart(ChartDataModel dataModel)
             throws DataFormatException
Constructs scatter chart from the given data model

Parameters:
dataModel - scatter chart data.
Throws:
DataFormatException
Method Detail

updateChart

protected void updateChart()
                    throws DataFormatException
Description copied from class: SpcChart
Redraws chart

Overrides:
updateChart in class SpcChart
Throws:
DataFormatException

updateMappers

protected void updateMappers(double minx,
                             double miny,
                             double maxx,
                             double maxy)
Updates chart mappers. (invoked when chart data is updated).

Parameters:
minx - minimum x
miny - minimum y
maxx - maximum x
maxy - maximum y

updateAxes

protected void updateAxes(ScatterValuesCalculator calc)
                   throws DataFormatException
Updates chart axes. (invoked when chart data is updated).

Parameters:
calc - chart values calculator
Throws:
DataFormatException

updateGrid

protected void updateGrid()
Updates grid. (invoked when chart data is updated).


updateTrendLine

protected void updateTrendLine(ScatterValuesCalculator calc)
                        throws DataFormatException
Updates chart trend line. (invoked when chart data is updated).

Parameters:
calc - chart values calculator.
Throws:
DataFormatException

updateScatter

protected void updateScatter(ScatterValuesCalculator calc)
                      throws DataFormatException
Updates scatter series. (invoked when chart data is updated).

Parameters:
calc - chart values calculator.
Throws:
DataFormatException

updateCorrelationMarker

protected void updateCorrelationMarker(ScatterValuesCalculator calc,
                                       double minx,
                                       double maxx,
                                       double miny,
                                       double maxy)
                                throws DataFormatException
Updates correlation marker. (invoked when chart data is updated).

Parameters:
calc - chart values calculator
minx - chart minimum x
maxx - chart maximum x
miny - chart minimum y
maxy - chart maximum y
Throws:
DataFormatException - when invalid chart data is supplied

updateEquationMarker

protected void updateEquationMarker(ScatterValuesCalculator calc,
                                    double minx,
                                    double maxx,
                                    double miny,
                                    double maxy)
                             throws DataFormatException
Updates trend line marker. (invoked when chart data is updated).

Parameters:
calc - chart values calculator
minx - chart minimum x
maxx - chart maximum x
miny - chart minimum y
maxy - chart maximum y
Throws:
DataFormatException - when invalid chart data is supplied

getTrendLineSeries

public LineSeries getTrendLineSeries()
Returns trend equation line series. Use setVisible(false) to hide it.


getTrendEquationMarker

public TextMarker getTrendEquationMarker()
Returns trend equation marker Use setVisible(false) to hide it.


getCorrelationCoefficientMarker

public TextMarker getCorrelationCoefficientMarker()
Returns correlation coefficient marker Use setVisible(false) to hide it.


getScatterSeries

public LineSeries getScatterSeries()
Returns scatter points series. Use setVisible(false) to hide it.


getScatterMarker

public AbstractMarker getScatterMarker()
Returns scatter points series marker. Default marker is DotMarker. Use setVisible(false) to hide it.


setScatterMarker

public void setScatterMarker(AbstractMarker marker)
Sets new marker for scatter series. The old one is removed and a new one is assigned to the scatter series.

Parameters:
marker - new marker