lt.monarch.chart.chart2D.series
Class PieSeries

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<Tags>
      extended by lt.monarch.chart.AbstractChartSeries<SeriesPaintTags,Projector>
          extended by lt.monarch.chart.chart2D.series.PieSeries
All Implemented Interfaces:
java.io.Serializable, ChartEntity, ChartObject, ChartSeries, StyleEditorEntity

public class PieSeries
extends AbstractChartSeries<SeriesPaintTags,Projector>

Displays data a 2D pie chart.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  TextStyle<AbstractPaintTags> textStyle
           
 
Fields inherited from class lt.monarch.chart.AbstractChartSeries
metaModel, model, modelValidator, seriesName, seriesTransform, showLegend, showNullValues, symbol, xMapper, yMapper, zMapper
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
PieSeries(DataModel model)
          Pie series constructor without a meta data model and default plane mapper is for Cartesian coordinates.
PieSeries(DataModel model, MetaDataModel metaModel)
          Pie series constructor without a default plane mapper is for Cartesian coordinates.
PieSeries(DataModel model, MetaDataModel metaModel, PlaneMapper mapper)
          Constructs a new pie series
PieSeries(DataModel model, PlaneMapper mapper)
          Pie series constructor without a meta data model
 
Method Summary
Modifier and Type Method and Description
 LegendEntry[] createLegendEntries()
          Creates legend entries for the series.
 void draw(AbstractGraphics g)
          Renders chart object on the Graphics context.
 Point2D getCenterPoint()
          Returns the center of pie
 double getInnerRadius()
          Returns the Doughnut inner radius.
 PieLabelAlignment getLabelAlignment()
          Return pie label alignment
 int getLabelAreaMultiplier()
          Returns label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size)
 PieLabelFormat getLabelFormat()
          Return label format
 java.lang.String getLabelFormatPattern()
          Returns pattern of label format
 AbstractPieLabelsLayouter getLabelLayouter()
          Return label layouter of pie
 PieLegendFormat getLegendFormat()
          Return legend format
 java.lang.String getLegendFormatPattern()
          Returns legend format pattern
 java.lang.Object getMaxValue(DataColumnType valType)
          Note: internal use only! Gets maximum value that is used by series to fit into the chart
 java.lang.Object getMinValue(DataColumnType valType)
          Note: internal use only! Gets minimum value that is used by series to fit into the chart
 int getNumbersLabelPrecision()
          Gets precision of labels values floating point numbers.
 int getNumbersLegendPrecision()
          Gets precision of legend values floating point numbers.
 double getOverallAngle()
          Returns the pie angle, how much angle the pie should occupy
 PaintMode getPaintMode()
          Returns the paint mode of the grid
 Projector getProjector()
          Returns modified projector.
 double getRadius()
          Returns pie series radius.
 double getStartAngle()
          Returns slice start angle of pie chart segment
 PieStrategy<Projector> getStrategy()
          Gets Pie drawing strategy.
 AbstractStyle getStyle(StyleType styleType)
          Gets style object for the stylesheet attributes specified by style type.
 TextStyle<AbstractPaintTags> getTextStyle()
          Gets series text style object
 void setCenterPoint(Point2D centerPoint)
          Set center of pie chart
 void setExplodeAndShrink(boolean flag)
          Set explode and shrink
 void setInnerRadius(java.lang.Double radius)
          Sets the Doughnut inner radius.
 void setLabelAlignment(PieLabelAlignment alignment)
          Set pie label alignment
 void setLabelAreaMultiplier(int labelAreaMultiplier)
          Specifies label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size) Default is 4.
 void setLabelFormat(PieLabelFormat labelFormat)
          Set label format
 void setLabelFormatPattern(java.lang.String labelFormatPattern)
          Set pattern of label format Examples: "%1$.2f, %2$.0f%%, %3$s" 1 - value, 2 - percent, 3 - slice name
 void setLabelLayouter(PieLabelsLayouters layouter)
          Set label layouter of pie
 void setLegendFormat(PieLegendFormat legendFormat)
          Set legend format
 void setLegendFormatPattern(java.lang.String legendFormatPattern)
          Set pattern of legend format Examples: "%1$.2f, %2$.0f%%, %3$s", where: 1 - value, 2 - percent, 3 - slice name
 void setNumbersLabelPrecision(int numbersLabelPrecision)
          Sets floating point numbers precision in the label values.
 void setNumbersLegendPrecision(int numbersLegendPrecision)
          Sets floating point numbers precision in the legend values.
 void setOverallAngle(double angle)
          Specifies the pie angle, how much angle the pie should occupy.
 void setPaintMode(PaintMode paintMode)
          Sets grid painting mode.
 void setRadius(double radius)
          Sets pie series radius.
 void setStartAngle(double angle)
          Sets start angle of pie chart segment.
 
Methods inherited from class lt.monarch.chart.AbstractChartSeries
activate, checkDataModelRequirements, createLegendEntry, createLegendSymbol, deactivate, fillEntitySheet, getChartObjectBounds, getDataModel, getDescription, getMetaDataModel, getModelValidator, getName, getNearestChildEntity, getParentEntity, getSeriesColor, getShortDescription, getShowNullValues, getSortPosition, getXMapper, getYMapper, getZMapper, handleDataModelChangeEvent, setLegendSymbol, setName, setShowNullValues, setValidateData, showLegend, updateClippingToProjector
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
chart, copy, dispose, finalize, getChart, getPaintStyle, getParent, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.ChartObject
dispose, getChart, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getParent
 

Field Detail

textStyle

protected TextStyle<AbstractPaintTags> textStyle
Constructor Detail

PieSeries

public PieSeries(DataModel model,
                 MetaDataModel metaModel,
                 PlaneMapper mapper)
Constructs a new pie series

Parameters:
model - chart data model
metaModel - meta data model
mapper - mapper, used to map output to a plane in a n-dimensional space

PieSeries

public PieSeries(DataModel model,
                 PlaneMapper mapper)
Pie series constructor without a meta data model

Parameters:
model - chart data model
mapper - mapper, used to map output to a plane in a n-dimensional space

PieSeries

public PieSeries(DataModel model,
                 MetaDataModel metaModel)
Pie series constructor without a default plane mapper is for Cartesian coordinates.

Parameters:
metaModel - meta data model
model - chart data model

PieSeries

public PieSeries(DataModel model)
Pie series constructor without a meta data model and default plane mapper is for Cartesian coordinates.

Parameters:
model - chart data model
Method Detail

draw

public void draw(AbstractGraphics g)
Description copied from interface: ChartObject
Renders chart object on the Graphics context.

Specified by:
draw in interface ChartObject
Overrides:
draw in class AbstractChartSeries<SeriesPaintTags,Projector>
Parameters:
g - graphics context

getProjector

public Projector getProjector()
Description copied from class: AbstractChartSeries
Returns modified projector.

Overrides:
getProjector in class AbstractChartSeries<SeriesPaintTags,Projector>
Returns:
projector

setPaintMode

public final void setPaintMode(PaintMode paintMode)
Sets grid painting mode. Possible values are: FILL_PAINT, HATCH_PAINT and GRADIENT_PAINT. FILL_PAINT for single color toFill-painting. GRADIENT_PAINT for cyclic (from start color to center color and from center color to start color) or acyclic (from start color to end color) gradient panel painting. By default the paint mode is set to FILL_PAINT.

Parameters:
paintMode - The paintMode to set.

getPaintMode

public final PaintMode getPaintMode()
Returns the paint mode of the grid

Returns:
Returns the paintMode.

setInnerRadius

public void setInnerRadius(java.lang.Double radius)
Sets the Doughnut inner radius.

Parameters:
radius - doughnut inner radius (in range [0, 0.5]).

getInnerRadius

public double getInnerRadius()
Returns the Doughnut inner radius.

Returns:
Doughnut inner radius.

setRadius

public void setRadius(double radius)
Sets pie series radius.

Parameters:
radius - radius of pie series in range [0,0.5]

getRadius

public double getRadius()
Returns pie series radius.

Returns:
pie radius.

setStartAngle

public void setStartAngle(double angle)
Sets start angle of pie chart segment.

Parameters:
angle - angle [0; 360]

getStartAngle

public double getStartAngle()
Returns slice start angle of pie chart segment

Returns:
startAngle

setOverallAngle

public void setOverallAngle(double angle)
Specifies the pie angle, how much angle the pie should occupy. Default value is 360 degrees.

Parameters:
angle - angle [0; 360]

getOverallAngle

public double getOverallAngle()
Returns the pie angle, how much angle the pie should occupy

Returns:
startAngle

setCenterPoint

public void setCenterPoint(Point2D centerPoint)
Set center of pie chart

Parameters:
centerPoint - point of the center the pie [0,1]

getCenterPoint

public Point2D getCenterPoint()
Returns the center of pie

Returns:
Point2D center of pie

setExplodeAndShrink

public void setExplodeAndShrink(boolean flag)
Set explode and shrink

Parameters:
flag - true, if explode and shrink, otherwise explode, but not shrink

getStrategy

public PieStrategy<Projector> getStrategy()
Gets Pie drawing strategy.


getLabelLayouter

public AbstractPieLabelsLayouter getLabelLayouter()
Return label layouter of pie

Returns:
label layouter

setLabelLayouter

public void setLabelLayouter(PieLabelsLayouters layouter)
Set label layouter of pie

Parameters:
layouter - label layouter

getLabelAlignment

public PieLabelAlignment getLabelAlignment()
Return pie label alignment

Returns:
label alignment

setLabelAlignment

public void setLabelAlignment(PieLabelAlignment alignment)
Set pie label alignment

Parameters:
alignment - label alignment

getMaxValue

public java.lang.Object getMaxValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets maximum value that is used by series to fit into the chart

Specified by:
getMaxValue in class AbstractChartSeries<SeriesPaintTags,Projector>
Parameters:
valType - data value column
Returns:
maximum value needed

getMinValue

public java.lang.Object getMinValue(DataColumnType valType)
Description copied from class: AbstractChartSeries
Note: internal use only! Gets minimum value that is used by series to fit into the chart

Specified by:
getMinValue in class AbstractChartSeries<SeriesPaintTags,Projector>
Parameters:
valType - data value column
Returns:
minimum value needed

createLegendEntries

public LegendEntry[] createLegendEntries()
Description copied from class: AbstractChartSeries
Creates legend entries for the series.

Specified by:
createLegendEntries in interface ChartSeries
Overrides:
createLegendEntries in class AbstractChartSeries<SeriesPaintTags,Projector>
Returns:
legend entries

getLabelFormatPattern

public java.lang.String getLabelFormatPattern()
Returns pattern of label format

Returns:
the labelFormatPattern

setLabelFormatPattern

public void setLabelFormatPattern(java.lang.String labelFormatPattern)
Set pattern of label format Examples: "%1$.2f, %2$.0f%%, %3$s" 1 - value, 2 - percent, 3 - slice name

Parameters:
labelFormatPattern - the labelFormatPattern to set

getLegendFormatPattern

public java.lang.String getLegendFormatPattern()
Returns legend format pattern

Returns:
the legendFormatPattern

setLegendFormatPattern

public void setLegendFormatPattern(java.lang.String legendFormatPattern)
Set pattern of legend format Examples: "%1$.2f, %2$.0f%%, %3$s", where: 1 - value, 2 - percent, 3 - slice name

Parameters:
legendFormatPattern - the legendFormatPattern to set

getLegendFormat

public PieLegendFormat getLegendFormat()
Return legend format

Returns:
the legendFormat

setLegendFormat

public void setLegendFormat(PieLegendFormat legendFormat)
Set legend format

Parameters:
legendFormat - the legendFormat to set

setLabelFormat

public void setLabelFormat(PieLabelFormat labelFormat)
Set label format

Parameters:
labelFormat - the labelFormat to set

getLabelFormat

public PieLabelFormat getLabelFormat()
Return label format

Returns:
the label format

getNumbersLabelPrecision

public int getNumbersLabelPrecision()
Gets precision of labels values floating point numbers.

Returns:
precision of chart's floating point numbers

setNumbersLabelPrecision

public void setNumbersLabelPrecision(int numbersLabelPrecision)
Sets floating point numbers precision in the label values. If precision is negative then precision will be set to 0.

Parameters:
numbersLabelPrecision - precision of floating point numbers.

getNumbersLegendPrecision

public int getNumbersLegendPrecision()
Gets precision of legend values floating point numbers.

Returns:
precision of chart's floating point numbers

setNumbersLegendPrecision

public void setNumbersLegendPrecision(int numbersLegendPrecision)
Sets floating point numbers precision in the legend values. If precision is negative then precision will be set to 0.

Parameters:
numbersLegendPrecision - precision of floating point numbers.

getTextStyle

public TextStyle<AbstractPaintTags> getTextStyle()
Gets series text style object

Returns:
the style of text object

getStyle

public AbstractStyle getStyle(StyleType styleType)
Description copied from interface: ChartObject
Gets style object for the stylesheet attributes specified by style type.

Specified by:
getStyle in interface ChartObject
Specified by:
getStyle in interface StyleEditorEntity
Overrides:
getStyle in class AbstractChartObject<SeriesPaintTags>
Parameters:
styleType - style type attributes
Returns:
the style object

setLabelAreaMultiplier

public void setLabelAreaMultiplier(int labelAreaMultiplier)
Specifies label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size) Default is 4.

Parameters:
labelAreaMultiplier - label area multiplier

getLabelAreaMultiplier

public int getLabelAreaMultiplier()
Returns label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size)

Returns:
label area multiplier