com.steema.teechart.styles
Class Pie

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.styles.Series
          extended by com.steema.teechart.styles.Circular
              extended by com.steema.teechart.styles.Pie
All Implemented Interfaces:
ISeries, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Donut

public class Pie
extends Circular

Title: Pie class

Description: Pie Series.

Example:


  pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
  pieSeries.getMarks().setVisible(true);
  pieSeries.getShadow().setVisible(true);
  pieSeries.getShadow().setHorizSize(20);
  pieSeries.getShadow().setVertSize(20);
  pieSeries.fillSampleValues(8);

  myChart.getHeader().setVisible(true);
  myChart.setText("Pie");
  myChart.getAspect().setElevation(315);
  myChart.getAspect().setOrthogonal(false);
  myChart.getAspect().setPerspective(0);
  myChart.getAspect().setRotation(360);
 

Copyright (c) 2005-2008 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL

See Also:
Serialized Form

Nested Class Summary
protected  class Pie.CompareSlice
           
 class Pie.ExplodedSliceList
          Title: ExplodedSliceList class Description: List to hold percents of exploding effect, one per each Pie slice.
 class Pie.PieOtherSlice
          Title: PieOtherSlice class Description: Pie series uses this class in its Pie.OtherSlice.
 class Pie.PieShadow
          Title: PieShadow class Description: Pie series uses this class in its Pie.Shadow.
 class Pie.SliceValueList
          Title: SliceValueList class Description: List to hold percents of height for each Pie slice.
 
Nested classes/interfaces inherited from class com.steema.teechart.styles.Series
Series.MarkTextResolver
 
Field Summary
 PieAngle[] angles
           
static int BelongsToOther
           
protected  int iDonutPercent
           
protected  int iniX
           
protected  int iniY
           
 
Fields inherited from class com.steema.teechart.styles.Circular
circleHeight, circleWidth, iAdjustCircleForMarks, iCircleXCenter, iCircleYCenter, iXRadius, iYRadius, PIDEGREE, rCircleRect, rotDegree
 
Fields inherited from class com.steema.teechart.styles.Series
AUTODEPTH, AUTOZORDER, bActive, bBrush, bColorEach, calcVisiblePoints, colorMember, customMarkText, drawBetweenPoints, endZ, firstVisible, hasZValues, iColors, InternalUse, iNumSampleValues, iZOrder, labelMember, lastVisible, listenerList, mandatory, manualData, marks, middleZ, notMandatory, percentDecimal, percentFormat, sLabels, startZ, useAxis, useSeriesColor, valueFormat, vxValues, vyValues, yMandatory
 
Fields inherited from class com.steema.teechart.TeeBase
chart
 
Constructor Summary
Pie()
           
Pie(IBaseChart c)
           
 
Method Summary
protected  void addSampleValues(int numValues)
           
 boolean belongsToOtherSlice(int valueIndex)
          Returns true if indexed Slice belongs to the Otherslice.
protected  Point calcExplodedRadius(int valueIndex)
           
 int calcXPos(int valueIndex)
          Returns the pixel Screen Horizontal coordinate of the ValueIndex Series value.
protected  void clearLists()
           
 int clicked(int x, int y)
          Returns the ValueIndex of the "clicked" point in the Series.
 void createSubGallery(Gallery addSubChart)
           
protected  void doAfterDrawValues()
           
 void doBeforeDrawChart()
           
protected  void doBeforeDrawValues()
           
protected  void draw()
           
protected  void drawMark(int valueIndex, java.lang.String s, SeriesMarksPosition position)
           
 void drawOutlineSlice(int valueIndex)
           
 void drawPie(int valueIndex, boolean last)
           
 void drawValue(int valueIndex)
          Called internally.
 void galleryChanged3D(boolean is3D)
           
 int getAngleSize()
          Total angle in degrees (0 to 360) for all slices.
 boolean getAutoMarkPosition()
          If true, marks will be displayed trying to not overlap one to each other.
 int getBevelPercent()
           
 ChartBrush getBrush()
          Brush fill for PieSeries.
 boolean getColorEach()
          Draws points with different preset Colors.
 int getCountLegendItems()
           
 boolean getDark3D()
          Darkens side of 3D pie section to add depth.
 boolean getDarkPen()
          Darkens pie slice borders.
 java.lang.String getDescription()
          Gets descriptive text.
 EdgeStyle getEdgeStyle()
           
 int getExplodeBiggest()
          Displaces the biggest slice from centre by value set.
 Pie.ExplodedSliceList getExplodedSlice()
          Accesses the properties for exploding any Pie slice.
 PieMarks getMarksPie()
           
 Pie.PieOtherSlice getOtherSlice()
          Accesses the OtherSlice properties.
 ChartPen getPen()
          Line pen for Pie.
 ValueList getPieValues()
          Stores the Pie slice values.
 Pie.PieShadow getShadow()
          Defines the offset shadow of the PieSeries.
 int getTransparency()
          The Transparency level from 0 to 100%.
 boolean getUsePatterns()
          Fills Pie Sectors with different Brush pattern styles.
 int legendToValueIndex(int legendIndex)
           
protected  int numSampleValues()
           
 void prepareForGallery(boolean isEnabled)
           
protected  void prepareLegendCanvas(IGraphics3D g, int valueIndex, Color backColor, ChartBrush aBrush)
           
 void setAngleSize(int value)
          Total angle in degrees (0 to 360) for all slices.
 void setAutoMarkPosition(boolean value)
          If true, marks will be displayed trying to not overlap one to each other.
 void setBevelPercent(int value)
           
 void setChart(IBaseChart c)
          Chart associated with this object.
 void setColorEach(boolean value)
          Draws points with different preset Colors.
 void setDark3D(boolean value)
          Darkens side of 3D pie section to add depth.
 void setDarkPen(boolean value)
          Darkens pie slice borders.
protected  void setDonutPercent(int value)
           
 void setEdgeStyle(EdgeStyle value)
           
 void setExplodeBiggest(int value)
          Displaces the biggest slice from centre by value set.
 void setMarksPie(PieMarks value)
           
 void setSubGallery(int index)
          Creates and prepares the index'th Series style to show at sub-gallery dialog.
 void setTransparency(int value)
          Sets Transparency level from 0 to 100%.
 void setUsePatterns(boolean value)
          Fills Pie Sectors with different Brush pattern styles.
 Pie.SliceValueList SliceHeight()
          Accesses the properties for setting any Pie slice height.
protected  void swapValueIndex(int a, int b)
          Exchanges one point with another.
 
Methods inherited from class com.steema.teechart.styles.Circular
adjustCircleRect, angleToPos, associatedToAxis, calcCircleBackColor, calcCircleGradient, calcRadius, getCircleBackColor, getCircled, getCircleGradient, getCircleHeight, getCircleRect, getCircleWidth, getCircleXCenter, getCircleYCenter, getCustomXRadius, getCustomYRadius, getRotationAngle, getXRadius, getYRadius, onDisposing, pointToAngle, pointToRadius, readResolve, reCalcCircleRect, rotate, setActive, setCircleBackColor, setCircled, setCustomXRadius, setCustomYRadius, setParentProperties, setRotationAngle, shouldSerializeCircleBackColor
 
Methods inherited from class com.steema.teechart.styles.Series
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addChartValue, added, addedValue, addNull, addNullXY, addSeriesMouseListener, addSeriesPaintListener, addValues, assign, assignDispose, assignValues, beginUpdate, calcFirstLastVisibleIndex, calcHorizMargins, calcPercentSt, calcPosValue, calculateMarkPosition, calcVerticalMargins, calcXPosValue, calcXSizeValue, calcYPos, calcYPosValue, calcYSizeValue, calcZOrder, canAddRandomPoints, changeType, checkDataSource, checkMouse, checkOrder, checkOtherSeries, clear, clicked, clone, cloneSeries, convertArray, countLegendItems, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doClick, doClickPointer, doDoubleClick, drawLegend, drawLegend, drawLegendShape, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValuesForward, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, getActive, getAllowSinglePoint, getBitmapEditor, getColor, getColorMember, getColors, getCount, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getLegendString, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxXValue, getMaxYValue, getMaxZValue, getMiddleZ, getMinXValue, getMinYValue, getMinZValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getPoint, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueColor, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasDataSource, hasListenersOf, hasNoMandatoryValues, isNull, isPointInChartRect, isValidSeriesSource, isValidSourceOf, lastDisplayed, lastVisibleMark, legendItemColor, maxMarkWidth, moreSameZOrder, mouseEvent, newFromType, randomBounds, recalcGetAxis, refreshSeries, removeMarkTextResolver, removeSeriesMouseListener, removeSeriesPaintListener, repaint, sameClass, setColor, setColorMember, setColors, setCursor, setCustomHorizAxis, setCustomHorizAxis, setCustomVertAxis, setCustomVertAxis, setDataSource, setDefaultNullValue, setDepth, setEndZ, setFunction, setHorizontal, setHorizontalAxis, setLabelMember, setLabels, setMarks, setMarkTextResolver, setMiddleZ, setNull, setNull, setPercentFormat, setSeriesColor, setShowInLegend, setStartZ, setTitle, setValueFormat, setValueList, setVerticalAxis, setVisible, setXValues, setYValues, setZOrder, setZPositions, sortByLabels, sortByLabels, titleOrName, toString, valuesListAdd, xScreenToValue, yScreenToValue
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.steema.teechart.styles.ISeries
getChart, invalidate
 

Field Detail

BelongsToOther

public static final int BelongsToOther
See Also:
Constant Field Values

iDonutPercent

protected int iDonutPercent

iniX

protected transient int iniX

iniY

protected transient int iniY

angles

public transient PieAngle[] angles
Constructor Detail

Pie

public Pie()

Pie

public Pie(IBaseChart c)
Method Detail

getPieValues

public ValueList getPieValues()
Stores the Pie slice values.

Returns:
ValueList

setChart

public void setChart(IBaseChart c)
Description copied from class: TeeBase
Chart associated with this object.

Specified by:
setChart in interface ISeries
Overrides:
setChart in class Circular
Parameters:
c - IBaseChart

setDonutPercent

protected void setDonutPercent(int value)

getColorEach

public boolean getColorEach()
Draws points with different preset Colors.
Default value: true

Specified by:
getColorEach in interface ISeries
Overrides:
getColorEach in class Series
Returns:
boolean

setColorEach

public void setColorEach(boolean value)
Draws points with different preset Colors.
Default value: true

Overrides:
setColorEach in class Series
Parameters:
value - boolean

getAngleSize

public int getAngleSize()
Total angle in degrees (0 to 360) for all slices.
Default value: 360

Returns:
int

setAngleSize

public void setAngleSize(int value)
Total angle in degrees (0 to 360) for all slices.
Default value: 360

Example:


 pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
 pieSeries.getMarks().setVisible(true);
 pieSeries.getMarks().setStyle(MarksStyle.LABELPERCENT);
 pieSeries.fillSampleValues(5);
 pieSeries.setAngleSize(180);
 pieSeries.setRotationAngle(90);
 

Parameters:
value - int

getDark3D

public boolean getDark3D()
Darkens side of 3D pie section to add depth.
When true, it fills the Pie 3D effect screen areas with darker colors than their corresponding Pie sectors. These colors look much better with 16k colors video mode or greater.
The Pie sector RGB color is increased to 40 units to obtain the darker color.
Default value: true

Returns:
boolean

setDark3D

public void setDark3D(boolean value)
Darkens side of 3D pie section to add depth.
Default value: true

Parameters:
value - boolean

getTransparency

public int getTransparency()
The Transparency level from 0 to 100%.
Transparency is a value between 0 and 100 which sets the transparency percentage with respect to foreground versus background.
Default value: 0

Returns:
int

setTransparency

public void setTransparency(int value)
Sets Transparency level from 0 to 100%.
Default value: 0

Parameters:
value - int

getEdgeStyle

public EdgeStyle getEdgeStyle()

setEdgeStyle

public void setEdgeStyle(EdgeStyle value)

getBevelPercent

public int getBevelPercent()

setBevelPercent

public void setBevelPercent(int value)

getDarkPen

public boolean getDarkPen()
Darkens pie slice borders.
Default value: false

Returns:
boolean

setDarkPen

public void setDarkPen(boolean value)
Darkens pie slice borders.
Default value: false

Parameters:
value - boolean

getExplodeBiggest

public int getExplodeBiggest()
Displaces the biggest slice from centre by value set.
Default value: 0

Returns:
int

setExplodeBiggest

public void setExplodeBiggest(int value)
Displaces the biggest slice from centre by value set.
Default value: 0

Parameters:
value - int

getOtherSlice

public Pie.PieOtherSlice getOtherSlice()
Accesses the OtherSlice properties.
For example, you can use it to define the grouping size for the 'Other' slice of the Pie.
Grouping may be expressed as a percentage or value.

Example:


 pieSeries.getOtherSlice().getLegend().setVisible(isSelected);
 

Returns:
PieOtherSlice
See Also:
Pie.PieOtherSlice.getStyle()

getPen

public ChartPen getPen()
Line pen for Pie.

Returns:
ChartPen

getBrush

public ChartBrush getBrush()
Brush fill for PieSeries.

Overrides:
getBrush in class Series
Returns:
ChartBrush

getShadow

public Pie.PieShadow getShadow()
Defines the offset shadow of the PieSeries.

Example:


 pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
 pieSeries.getMarks().setVisible(true);
 pieSeries.getShadow().setVisible(true);
 pieSeries.getShadow().setWidth(30);
 pieSeries.getShadow().setHeight(50);
 pieSeries.getShadow().setColor(Color.SILVER);
 pieSeries.fillSampleValues(9);

 

Returns:
PieShadow

getUsePatterns

public boolean getUsePatterns()
Fills Pie Sectors with different Brush pattern styles.
Default value: false

Returns:
boolean

setUsePatterns

public void setUsePatterns(boolean value)
Fills Pie Sectors with different Brush pattern styles.
Default value: false

Parameters:
value - boolean

getAutoMarkPosition

public boolean getAutoMarkPosition()
If true, marks will be displayed trying to not overlap one to each other.
Default value: true

Returns:
boolean

setAutoMarkPosition

public void setAutoMarkPosition(boolean value)
If true, marks will be displayed trying to not overlap one to each other.
Default value: true

Parameters:
value - boolean

galleryChanged3D

public void galleryChanged3D(boolean is3D)
Overrides:
galleryChanged3D in class Series

swapValueIndex

protected void swapValueIndex(int a,
                              int b)
Description copied from class: Series
Exchanges one point with another. Also the point color and point label.

Overrides:
swapValueIndex in class Series
Parameters:
a - int index of first point to exchange.
b - int index of second point to exchange.

addSampleValues

protected void addSampleValues(int numValues)
Overrides:
addSampleValues in class Series

calcExplodedRadius

protected Point calcExplodedRadius(int valueIndex)

clearLists

protected void clearLists()
Overrides:
clearLists in class Series

doBeforeDrawChart

public void doBeforeDrawChart()
Overrides:
doBeforeDrawChart in class Series

doBeforeDrawValues

protected void doBeforeDrawValues()
Overrides:
doBeforeDrawValues in class Circular

doAfterDrawValues

protected void doAfterDrawValues()
Overrides:
doAfterDrawValues in class Series

draw

protected void draw()
Overrides:
draw in class Series

drawMark

protected void drawMark(int valueIndex,
                        java.lang.String s,
                        SeriesMarksPosition position)
Overrides:
drawMark in class Series

getMarksPie

public PieMarks getMarksPie()

setMarksPie

public void setMarksPie(PieMarks value)

drawOutlineSlice

public void drawOutlineSlice(int valueIndex)

drawPie

public void drawPie(int valueIndex,
                    boolean last)

drawValue

public void drawValue(int valueIndex)
Called internally. Draws the "ValueIndex" point of the Series.

Specified by:
drawValue in interface ISeries
Overrides:
drawValue in class Series
Parameters:
valueIndex - int

numSampleValues

protected int numSampleValues()
Overrides:
numSampleValues in class Series

prepareForGallery

public void prepareForGallery(boolean isEnabled)
Overrides:
prepareForGallery in class Series

legendToValueIndex

public int legendToValueIndex(int legendIndex)
Specified by:
legendToValueIndex in interface ISeries
Overrides:
legendToValueIndex in class Series

prepareLegendCanvas

protected void prepareLegendCanvas(IGraphics3D g,
                                   int valueIndex,
                                   Color backColor,
                                   ChartBrush aBrush)
Overrides:
prepareLegendCanvas in class Circular

belongsToOtherSlice

public boolean belongsToOtherSlice(int valueIndex)
Returns true if indexed Slice belongs to the Otherslice.
The "other" slice is controlled by the OtherSlice method, and is used to join several small slices into a single bigger one.

Parameters:
valueIndex - int
Returns:
boolean

calcXPos

public int calcXPos(int valueIndex)
Returns the pixel Screen Horizontal coordinate of the ValueIndex Series value.

Overrides:
calcXPos in class Series
Parameters:
valueIndex - int
Returns:
int

clicked

public int clicked(int x,
                   int y)
Description copied from class: Series
Returns the ValueIndex of the "clicked" point in the Series.
Clicked means the X and Y coordinates are in the point screen region bounds. If no point is "touched", Clicked returns -1

Specified by:
clicked in interface ISeries
Overrides:
clicked in class Series
Parameters:
x - int
y - int
Returns:
int

getCountLegendItems

public int getCountLegendItems()
Specified by:
getCountLegendItems in interface ISeries
Overrides:
getCountLegendItems in class Series

createSubGallery

public void createSubGallery(Gallery addSubChart)
Overrides:
createSubGallery in class Series

setSubGallery

public void setSubGallery(int index)
Description copied from class: Series
Creates and prepares the index'th Series style to show at sub-gallery dialog.

Specified by:
setSubGallery in interface ISeries
Overrides:
setSubGallery in class Series
Parameters:
index - int

getExplodedSlice

public Pie.ExplodedSliceList getExplodedSlice()
Accesses the properties for exploding any Pie slice.

Returns:
ExplodedSliceList

SliceHeight

public Pie.SliceValueList SliceHeight()
Accesses the properties for setting any Pie slice height.

Returns:
SliceValueList

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Series
Returns:
String