lt.monarch.chart.spc.math
Class ScatterValuesCalculator

java.lang.Object
  extended by lt.monarch.chart.spc.math.ValuesCalculator
      extended by lt.monarch.chart.spc.math.ScatterValuesCalculator

public class ScatterValuesCalculator
extends ValuesCalculator

Calculates values for the scatter chart. Values are calculated using formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.7.1.html


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.spc.math.ValuesCalculator
nullName
 
Constructor Summary
Constructor and Description
ScatterValuesCalculator()
           
 
Method Summary
Modifier and Type Method and Description
 java.lang.String[] getLabels(ChartDataModel srcModel)
          Returns axis labels.
 double getR(ChartDataModel srcModel)
          Calculates data correlation coefficient.
 void getScatterPlot(ChartDataModel srcModel, ChartDataModel resultModel)
          Calculates data model for a scatter series
 java.lang.String getTrendEquation(ChartDataModel srcModel)
          Constructs trend line equation.
 void getTrendLine(ChartDataModel srcModel, ChartDataModel resultModel)
          Creates data model for chart trend line.
protected  void validateDataModel(ChartDataModel dataModel)
          Validates data model.
 
Methods inherited from class lt.monarch.chart.spc.math.ValuesCalculator
average, fill, fill, fillColumn, fillColumn, fillConstant, fillConstant, getAverage, getc4, getColumn, getd2, getd3, getD3, getD4, getDouble, getE, getF, getG, getH, isEmpty, isNconstant, validateDataModel, validateDataModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScatterValuesCalculator

public ScatterValuesCalculator()
Method Detail

getScatterPlot

public void getScatterPlot(ChartDataModel srcModel,
                           ChartDataModel resultModel)
                    throws DataFormatException
Calculates data model for a scatter series

Parameters:
srcModel - input data model.
resultModel - destination data model.
Throws:
DataFormatException - when the input data are invalid.

getLabels

public java.lang.String[] getLabels(ChartDataModel srcModel)
                             throws DataFormatException
Returns axis labels.

Parameters:
srcModel - input data model
Returns:
0th element - x axis, 1st element y axis label.
Throws:
DataFormatException - when the input data are invalid.

getTrendLine

public void getTrendLine(ChartDataModel srcModel,
                         ChartDataModel resultModel)
                  throws DataFormatException
Creates data model for chart trend line.

Parameters:
srcModel - input data model.
resultModel - destination data model.
Throws:
DataFormatException - when the input data are invalid.

getTrendEquation

public java.lang.String getTrendEquation(ChartDataModel srcModel)
                                  throws DataFormatException
Constructs trend line equation.

Parameters:
srcModel - input data model.
Returns:
trend lien equation.
Throws:
DataFormatException - when the input data are invalid.

getR

public double getR(ChartDataModel srcModel)
            throws DataFormatException
Calculates data correlation coefficient.

Parameters:
srcModel - input data model.
Returns:
correlation coefficient.
Throws:
DataFormatException - when the input data are invalid.

validateDataModel

protected void validateDataModel(ChartDataModel dataModel)
                          throws DataFormatException
Description copied from class: ValuesCalculator
Validates data model. Checks if it satisfies chart type requirements.

Specified by:
validateDataModel in class ValuesCalculator
Parameters:
dataModel - input chart data model.
Throws:
DataFormatException - when the data is invalid.