C# Class System.Drawing.PieChart.PieChart3D

Object representing a pie chart.
Inheritance: IDisposable
显示文件 Open project: Longkong/Pojjaman Class Usage Examples

Protected Properties

Property Type Description
m_edgeColorType EdgeColorType
m_edgeLineWidth float
m_fitToBoundingRectangle bool
m_font System.Drawing.Font
m_foreColor Color
m_heightBoundingRect float
m_highlightedIndex int
m_initialAngle float
m_pieSlices System.Drawing.PieChart.PieSlice[]
m_pieSlicesMapping System.Collections.ArrayList
m_shadowStyle ShadowStyle
m_sliceColors Color[]
m_sliceRelativeDisplacements float[]
m_sliceRelativeHeight float
m_texts string[]
m_values decimal[]
m_widthBoundingRect float
m_xBoundingRect float
m_yBoundingRect float

Public Methods

Method Description
Dispose ( ) : void

Disposes of all pie slices.

Draw ( Graphics graphics ) : void

Draws the chart.

FindPieSliceUnderPoint ( PointF point ) : int

Searches the chart to find the index of the pie slice which contains point given. Search order goes in the direction opposite to drawing order.

PieChart3D ( RectangleF boundingRectangle, decimal values, Color sliceColors, float sliceRelativeHeight ) : System

Initializes a new instance of PieChart3D with given bounds, array of values and corresponding colors.

PieChart3D ( RectangleF boundingRectangle, decimal values, float sliceRelativeHeight ) : System

Initializes a new instance of PieChart3D with given bounds, array of values and pie slice thickness.

PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values ) : System

Initializes an instance of a flat PieChart3D with specified bounds, values to chart and relative thickness.

PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, Color sliceColors, float sliceRelativeHeight ) : System

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.

PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, Color sliceColors, float sliceRelativeHeight, string texts ) : System

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.

PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, float sliceRelativeHeight ) : System

Initializes an instance of PieChart3D with specified bounds, values to chart and relative thickness.

PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, float sliceRelativeHeight, string texts ) : System

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.

PlaceTexts ( Graphics graphics ) : void

Draws strings by individual slices. Position of the text is calculated by overridable GetTextPosition method of the PieSlice type.

Protected Methods

Method Description
CreatePieSlice ( float boundingRectLeft, float boundingRectTop, float boundingRectWidth, float boundingRectHeight, float sliceHeight, float startAngle, float sweepAngle, Color color, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : PieSlice

Creates a PieSlice object.

CreatePieSliceHighlighted ( float boundingRectLeft, float boundingRectTop, float boundingRectWidth, float boundingRectHeight, float sliceHeight, float startAngle, float sweepAngle, Color color, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : PieSlice

Creates highlighted PieSlice object.

DrawBottoms ( Graphics graphics ) : void

Draws bottom sides of all pie slices.

DrawSliceSides ( Graphics graphics ) : void

Draws outer peripheries of all slices.

DrawTops ( Graphics graphics ) : void

Draws top sides of all pie slices.

GetFittingRectangle ( ) : RectangleF

Finds the smallest rectangle int which chart fits entirely.

GetSliceDisplacement ( float angle, float displacementFactor ) : SizeF

Calculates the displacement for given angle.

InitializePieSlices ( ) : void

Initializes pies.

PieChart3D ( ) : System

Initializes an empty instance of PieChart3D.

ReadjustSlices ( RectangleF newBoundingRectangle ) : void

Readjusts each slice for new bounding rectangle.

Private Methods

Method Description
AreDisplacementsValid ( float displacements ) : bool

Helper function used in assertions. Checks the validity of slice displacements.

GetForemostPieSlice ( PieSlice pieSlices ) : int

Return the index of the foremost pie slice i.e. the one crossing 90 degrees boundary.

IsDisplacementValid ( float value ) : bool

Helper function used in assertions. Checks the validity of a slice displacement.

Method Details

CreatePieSlice() protected method

Creates a PieSlice object.
protected CreatePieSlice ( float boundingRectLeft, float boundingRectTop, float boundingRectWidth, float boundingRectHeight, float sliceHeight, float startAngle, float sweepAngle, Color color, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : PieSlice
boundingRectLeft float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the slice. ///
boundingRectTop float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the slice. ///
boundingRectWidth float /// Width of the rectangle that is used to draw the top surface of /// the slice. ///
boundingRectHeight float /// Height of the rectangle that is used to draw the top surface of /// the slice. ///
sliceHeight float /// Slice height. ///
startAngle float /// Starting angle. ///
sweepAngle float /// Sweep angle. ///
color Color /// Color used for slice rendering. ///
shadowStyle ShadowStyle /// Shadow style used for slice rendering. ///
edgeColorType EdgeColorType /// Edge lines color type. ///
edgeLineWidth float /// Edge lines width. ///
return PieSlice

CreatePieSliceHighlighted() protected method

Creates highlighted PieSlice object.
protected CreatePieSliceHighlighted ( float boundingRectLeft, float boundingRectTop, float boundingRectWidth, float boundingRectHeight, float sliceHeight, float startAngle, float sweepAngle, Color color, ShadowStyle shadowStyle, EdgeColorType edgeColorType, float edgeLineWidth ) : PieSlice
boundingRectLeft float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the slice. ///
boundingRectTop float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the slice. ///
boundingRectWidth float /// Width of the rectangle that is used to draw the top surface of /// the slice. ///
boundingRectHeight float /// Height of the rectangle that is used to draw the top surface of /// the slice. ///
sliceHeight float /// Slice height. ///
startAngle float /// Starting angle. ///
sweepAngle float /// Sweep angle. ///
color Color /// Color used for slice rendering. ///
shadowStyle ShadowStyle /// Shadow style used for slice rendering. ///
edgeColorType EdgeColorType /// Edge lines color type. ///
edgeLineWidth float /// Edge lines width. ///
return PieSlice

Dispose() public method

Disposes of all pie slices.
public Dispose ( ) : void
return void

Draw() public method

Draws the chart.
public Draw ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics object used for drawing. ///
return void

DrawBottoms() protected method

Draws bottom sides of all pie slices.
protected DrawBottoms ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics used for drawing. ///
return void

DrawSliceSides() protected method

Draws outer peripheries of all slices.
protected DrawSliceSides ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics used for drawing. ///
return void

DrawTops() protected method

Draws top sides of all pie slices.
protected DrawTops ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics used for drawing. ///
return void

FindPieSliceUnderPoint() public method

Searches the chart to find the index of the pie slice which contains point given. Search order goes in the direction opposite to drawing order.
public FindPieSliceUnderPoint ( PointF point ) : int
point System.Drawing.PointF /// PointF point for which pie slice is searched for. ///
return int

GetFittingRectangle() protected method

Finds the smallest rectangle int which chart fits entirely.
protected GetFittingRectangle ( ) : RectangleF
return System.Drawing.RectangleF

GetSliceDisplacement() protected method

Calculates the displacement for given angle.
protected GetSliceDisplacement ( float angle, float displacementFactor ) : SizeF
angle float /// Angle (in degrees). ///
displacementFactor float /// Displacement factor. ///
return System.Drawing.SizeF

InitializePieSlices() protected method

Initializes pies.
protected InitializePieSlices ( ) : void
return void

PieChart3D() protected method

Initializes an empty instance of PieChart3D.
protected PieChart3D ( ) : System
return System

PieChart3D() public method

Initializes a new instance of PieChart3D with given bounds, array of values and corresponding colors.
public PieChart3D ( RectangleF boundingRectangle, decimal values, Color sliceColors, float sliceRelativeHeight ) : System
boundingRectangle System.Drawing.RectangleF /// Bounding rectangle. ///
values decimal /// Array of values to chart. ///
sliceColors Color /// Colors used for rendering individual slices. ///
sliceRelativeHeight float /// Pie slice relative height. ///
return System

PieChart3D() public method

Initializes a new instance of PieChart3D with given bounds, array of values and pie slice thickness.
public PieChart3D ( RectangleF boundingRectangle, decimal values, float sliceRelativeHeight ) : System
boundingRectangle System.Drawing.RectangleF /// Bounding rectangle. ///
values decimal /// Array of values to initialize with. ///
sliceRelativeHeight float
return System

PieChart3D() public method

Initializes an instance of a flat PieChart3D with specified bounds, values to chart and relative thickness.
public PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle that /// bounds the chart. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle that /// bounds the chart. ///
widthBoundingRect float /// Width of the rectangle that bounds the chart. ///
heightBoundingRect float /// Height of the rectangle that bounds the chart. ///
values decimal /// An array of decimal values to chart. ///
return System

PieChart3D() public method

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.
public PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, Color sliceColors, float sliceRelativeHeight ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
widthBoundingRect float /// Width of the rectangle bounding the chart. ///
heightBoundingRect float /// Height of the rectangle bounding the chart. ///
values decimal /// An array of decimal values to chart. ///
sliceColors Color /// An array of colors used to render slices. ///
sliceRelativeHeight float /// Thickness of the slice to chart relative to the height of the /// bounding rectangle. ///
return System

PieChart3D() public method

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.
public PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, Color sliceColors, float sliceRelativeHeight, string texts ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
widthBoundingRect float /// Width of the rectangle bounding the chart. ///
heightBoundingRect float /// Height of the rectangle bounding the chart. ///
values decimal /// An array of decimal values to chart. ///
sliceColors Color /// An array of colors used to render slices. ///
sliceRelativeHeight float /// Thickness of the slice to chart relative to the height of the /// bounding rectangle. ///
texts string /// An array of strings that are displayed on corresponding slice. ///
return System

PieChart3D() public method

Initializes an instance of PieChart3D with specified bounds, values to chart and relative thickness.
public PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, float sliceRelativeHeight ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
widthBoundingRect float /// Width of the rectangle bounding the chart. ///
heightBoundingRect float /// Height of the rectangle bounding the chart. ///
values decimal /// An array of decimal values to chart. ///
sliceRelativeHeight float /// Thickness of the pie slice to chart relative to the height of the /// bounding rectangle. ///
return System

PieChart3D() public method

Initializes a new instance of PieChart3D with given bounds, array of values and relative pie slice height.
public PieChart3D ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, decimal values, float sliceRelativeHeight, string texts ) : System
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle bounding /// the chart. ///
widthBoundingRect float /// Width of the rectangle bounding the chart. ///
heightBoundingRect float /// Height of the rectangle bounding the chart. ///
values decimal /// An array of decimal values to chart. ///
sliceRelativeHeight float /// Thickness of the slice to chart relative to the height of the /// bounding rectangle. ///
texts string /// An array of strings that are displayed on corresponding slice. ///
return System

PlaceTexts() public method

Draws strings by individual slices. Position of the text is calculated by overridable GetTextPosition method of the PieSlice type.
public PlaceTexts ( Graphics graphics ) : void
graphics System.Drawing.Graphics /// Graphics object. ///
return void

ReadjustSlices() protected method

Readjusts each slice for new bounding rectangle.
protected ReadjustSlices ( RectangleF newBoundingRectangle ) : void
newBoundingRectangle System.Drawing.RectangleF /// RectangleF representing new boundary. ///
return void

Property Details

m_edgeColorType protected_oe property

Edge color type used for rendering.
protected EdgeColorType m_edgeColorType
return EdgeColorType

m_edgeLineWidth protected_oe property

Edge line width.
protected float m_edgeLineWidth
return float

m_fitToBoundingRectangle protected_oe property

Should the chart fit the bounding rectangle exactly.
protected bool m_fitToBoundingRectangle
return bool

m_font protected_oe property

Font used to display texts.
protected Font,System.Drawing m_font
return System.Drawing.Font

m_foreColor protected_oe property

Fore color used to display texts.
protected Color m_foreColor
return Color

m_heightBoundingRect protected_oe property

Height of the bounding rectangle.
protected float m_heightBoundingRect
return float

m_highlightedIndex protected_oe property

Index of the currently highlighted pie slice.
protected int m_highlightedIndex
return int

m_initialAngle protected_oe property

Initial angle from which chart is drawn.
protected float m_initialAngle
return float

m_pieSlices protected_oe property

Array of ordered pie slices constituting the chart, starting from 270 degrees axis.
protected PieSlice[],System.Drawing.PieChart m_pieSlices
return System.Drawing.PieChart.PieSlice[]

m_pieSlicesMapping protected_oe property

Collection of reordered pie slices mapped to original order.
protected ArrayList,System.Collections m_pieSlicesMapping
return System.Collections.ArrayList

m_shadowStyle protected_oe property

Shadow style.
protected ShadowStyle m_shadowStyle
return ShadowStyle

m_sliceColors protected_oe property

Array of colors used for rendering.
protected Color[] m_sliceColors
return Color[]

m_sliceRelativeDisplacements protected_oe property

Array of relative displacements from the common center.
protected float[] m_sliceRelativeDisplacements
return float[]

m_sliceRelativeHeight protected_oe property

Slice relative height.
protected float m_sliceRelativeHeight
return float

m_texts protected_oe property

Array of description texts.
protected string[] m_texts
return string[]

m_values protected_oe property

Array of values to be presented by the chart.
protected decimal[] m_values
return decimal[]

m_widthBoundingRect protected_oe property

Width of the bounding rectangle.
protected float m_widthBoundingRect
return float

m_xBoundingRect protected_oe property

x-coordinate of the top left corner of the bounding rectangle.
protected float m_xBoundingRect
return float

m_yBoundingRect protected_oe property

y-coordinate of the top left corner of the bounding rectangle.
protected float m_yBoundingRect
return float