lt.monarch.chart.spc
Class BoxWhiskerChart

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.BoxWhiskerChart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Chart<Projector2D>, ChartEntity, StyleEditorEntity, View

public class BoxWhiskerChart
extends SpcChart

The box and whiskers chart displays the three quartiles, the minimum, and the maximum of the data on a rectangular box. Chart values are calculated using the following formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.8.1.html

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  ChartDataModel bottomWhiskerData
           
protected  ChartDataModel boxData
           
protected  BarSeries boxSeries
           
protected  BoxWhiskerValuesCalculator calc
           
protected  double markerMaxSize_median
           
protected  ChartDataModel medianData
           
protected  AbstractMarker medianMarker
           
protected  LineSeries medianSeries
           
protected  Orientation orientation
           
protected  BoxWhiskerSeries series
           
protected  ChartDataModel topWhiskerData
           
protected  AxisMapper xMapper
           
protected  AxisMapper 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
BoxWhiskerChart()
          Constructs empty box and whiskers chart.
BoxWhiskerChart(ChartDataModel dataModel, Orientation orientation)
          Constructs box and whiskers chart.
 
Method Summary
Modifier and Type Method and Description
 BarSeries getBoxSeries()
          Returns box series
 AbstractMarker getMedianMarker()
          Returns median marker
 LineSeries getMedianSeries()
          Returns median series
 BoxWhiskerSeries getSeries()
          Box and whiskers series.
 PaintStyle<AbstractPaintTags> getWhiskerLineStyle()
          Returns whisker line draw style
 AbstractMarker getWhiskerMarker()
          Returns whisker marker.
protected  void paintChart(AbstractGraphics g)
          Paints the chart.
 void setMedianMarker(AbstractMarker marker)
          Sets median marker
 void setWhiskerMarker(AbstractMarker marker)
          Sets whisker marker.
protected  void updateAxes()
          Creates chart axes on chart creation.
protected  void updateBoxSeries()
          Creates box series on chart creation or updates it on chart data model change.
protected  void updateBoxWhiskerSeries()
          Creates box whisker series on chart creation or updates it on chart data model change.
protected  void updateChart()
          Redraws chart
protected  void updateGrid()
          Creates chart grid on chart creation.
protected  void updateMappers(java.util.List<java.lang.String> labels)
          Creates chart axes mappers on chart creation or updates them on chart data model change.
protected  void updateMedianSeries()
          Creates median series on chart creation.
 
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, 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

calc

protected BoxWhiskerValuesCalculator calc

boxData

protected ChartDataModel boxData

medianData

protected ChartDataModel medianData

topWhiskerData

protected ChartDataModel topWhiskerData

bottomWhiskerData

protected ChartDataModel bottomWhiskerData

series

protected BoxWhiskerSeries series

boxSeries

protected BarSeries boxSeries

medianSeries

protected LineSeries medianSeries

medianMarker

protected AbstractMarker medianMarker

yMapper

protected AxisMapper yMapper

xMapper

protected AxisMapper xMapper

orientation

protected Orientation orientation

markerMaxSize_median

protected double markerMaxSize_median
Constructor Detail

BoxWhiskerChart

public BoxWhiskerChart()
                throws DataFormatException
Constructs empty box and whiskers chart.

Throws:
DataFormatException

BoxWhiskerChart

public BoxWhiskerChart(ChartDataModel dataModel,
                       Orientation orientation)
                throws DataFormatException
Constructs box and whiskers chart.

Parameters:
dataModel - chart input data.
orientation - chart orientation
Throws:
DataFormatException
Method Detail

getSeries

public BoxWhiskerSeries getSeries()
Box and whiskers series. use, get methods to access whisker markers. use setVisible(false) to hide it.

Returns:

getBoxSeries

public BarSeries getBoxSeries()
Returns box series

Returns:

updateChart

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

Overrides:
updateChart in class SpcChart
Throws:
DataFormatException

updateMappers

protected void updateMappers(java.util.List<java.lang.String> labels)
Creates chart axes mappers on chart creation or updates them on chart data model change.


updateAxes

protected void updateAxes()
Creates chart axes on chart creation.


updateGrid

protected void updateGrid()
Creates chart grid on chart creation.


updateBoxWhiskerSeries

protected void updateBoxWhiskerSeries()
Creates box whisker series on chart creation or updates it on chart data model change.


updateBoxSeries

protected void updateBoxSeries()
Creates box series on chart creation or updates it on chart data model change.


updateMedianSeries

protected void updateMedianSeries()
Creates median series on chart creation.


paintChart

protected void paintChart(AbstractGraphics g)
Description copied from class: MultiSeriesChartBase
Paints the chart. Static layout methods for AbstractBarSeries are called. Layout method itself is not static, but bar and series spacing access methods are static. All chart objects are drawn.

Overrides:
paintChart in class Chart2D
Parameters:
g - the Graphics context in which chart will be painted
See Also:
AbstractBarSeries.layout(int, int)

getWhiskerMarker

public AbstractMarker getWhiskerMarker()
Returns whisker marker.


setWhiskerMarker

public void setWhiskerMarker(AbstractMarker marker)
Sets whisker marker.

Parameters:
marker - new whisker marker

getMedianMarker

public AbstractMarker getMedianMarker()
Returns median marker


setMedianMarker

public void setMedianMarker(AbstractMarker marker)
Sets median marker

Parameters:
marker - new median marker

getMedianSeries

public LineSeries getMedianSeries()
Returns median series

Returns:

getWhiskerLineStyle

public PaintStyle<AbstractPaintTags> getWhiskerLineStyle()
Returns whisker line draw style