lt.monarch.chart.spc
Class SpcChart

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
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Chart<Projector2D>, ChartEntity, StyleEditorEntity, View
Direct Known Subclasses:
BarChart, BoxWhiskerChart, ControlChart, DotPlotChart, HistogramChart, LinePlotChart, ParetoChart, ScatterChart

public abstract class SpcChart
extends Chart2D

Base class for SPC charts

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Axis2DX bottomAxis
           
protected  ChartDataModel dataModel
           
protected  Grid grid
           
protected  Axis2DY leftAxis
           
protected  Axis2DY 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
SpcChart()
          Constructs SPC chart.
SpcChart(ChartDataModel dataModel)
          Constructs SPC chart.
 
Method Summary
Modifier and Type Method and Description
 Axis2DX getBottomAxis()
          Returns bottom axis
 ChartDataModel getDataModel()
          Chart input data model.
 Grid getGrid()
          Returns grid object on the chart (if available)
 Axis2DY getLeftAxis()
          Returns left axis
protected  double getMax(ChartDataModel dataModel)
          Finds the maximum value in the data model.
protected  double getMax(ChartDataModel dataModel, double max)
          Finds the maximum value in the data model.
protected  double getMin(ChartDataModel dataModel)
          Finds the minimum value in the data model.
protected  double getMin(ChartDataModel dataModel, double min)
          Finds the minimum value in the data model.
 Axis2DY getRightAxis()
          Returns right axis
protected  ChartDataModel resetDataModel(ChartDataModel model)
          Removes data from the data model.
 void setDataModel(ChartDataModel dataModel)
          Assigns input data model to the chart.
 void setNoData(DataFormatException ex)
          Sets no data information on the chart.
 void setNoData(java.lang.String message)
          Sets no data information on the chart.
protected  void trim(ChartDataModel dataModel)
          Removes empty data rows from data model.
protected  void updateChart()
          Redraws chart
 
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

dataModel

protected ChartDataModel dataModel

grid

protected Grid grid

bottomAxis

protected Axis2DX bottomAxis

leftAxis

protected Axis2DY leftAxis

rightAxis

protected Axis2DY rightAxis
Constructor Detail

SpcChart

public SpcChart()
Constructs SPC chart.


SpcChart

public SpcChart(ChartDataModel dataModel)
         throws DataFormatException
Constructs SPC chart.

Parameters:
dataModel - input data model.
Throws:
when - input data are invalid
DataFormatException
Method Detail

getLeftAxis

public Axis2DY getLeftAxis()
Returns left axis


getRightAxis

public Axis2DY getRightAxis()
Returns right axis


getBottomAxis

public Axis2DX getBottomAxis()
Returns bottom axis


getGrid

public Grid getGrid()
Returns grid object on the chart (if available)


getMax

protected double getMax(ChartDataModel dataModel,
                        double max)
Finds the maximum value in the data model.

Parameters:
dataModel - input data mode.
max - initial maximum value.
Returns:
discovered maximum value if it is lager than max parameter, otherwise max is returned.

getMin

protected double getMin(ChartDataModel dataModel,
                        double min)
Finds the minimum value in the data model.

Parameters:
dataModel - input data mode.
min - initial minimum value.
Returns:
discovered minimum value if it is smaller than min parameter, otherwise min is returned.

getMin

protected double getMin(ChartDataModel dataModel)
                 throws DataFormatException
Finds the minimum value in the data model.

Parameters:
dataModel - input data model.
Returns:
discovered minimum value (if not found Double.MAX_VALUE is returned).
Throws:
DataFormatException - when input data are invalid (does not contain only numbers).

getMax

protected double getMax(ChartDataModel dataModel)
                 throws DataFormatException
Finds the maximum value in the data model.

Parameters:
dataModel - input data model.
Returns:
discovered maximum value (if not found Double.MIN_VALUE is returned).
Throws:
DataFormatException - when input data are invalid (does not contain only numbers).

getDataModel

public ChartDataModel getDataModel()
Chart input data model.


setDataModel

public void setDataModel(ChartDataModel dataModel)
                  throws DataFormatException
Assigns input data model to the chart. After assigning the data, chart is redrawn.

Parameters:
dataModel - chat input data model.
Throws:
when - input data are invalid
DataFormatException

updateChart

protected void updateChart()
                    throws DataFormatException
Redraws chart

Throws:
DataFormatException

trim

protected void trim(ChartDataModel dataModel)
Removes empty data rows from data model.

Parameters:
dataModel - source and destination data model.

setNoData

public void setNoData(DataFormatException ex)
Sets no data information on the chart. Displayed in the case of error.

Parameters:
ex - error exception

setNoData

public void setNoData(java.lang.String message)
Sets no data information on the chart. Displayed in the case of error.

Parameters:
message - error message

resetDataModel

protected ChartDataModel resetDataModel(ChartDataModel model)
Removes data from the data model. If the new model is null, the new one is created.

Parameters:
model - input data model.
Returns:
updated/new data model.