Class PieItem
A class representing a pie chart object comprised of one or more PieItems.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class PieItem : CurveItem, ICloneable, ISerializable
Constructors
| Improve this Doc View SourcePieItem(Double, Color, Double, String)
Create a new PieItem.
Declaration
public PieItem(double pieValue, Color color, double displacement, string label)
Parameters
Type | Name | Description |
---|---|---|
Double | pieValue | The value associated with this PieItem instance. |
Color | color | The display color for this PieItem instance. |
Double | displacement | The amount this PieItem instance will be displaced from the center point. |
String | label | Text label for this PieItem instance. |
PieItem(Double, Color, Color, Single, Double, String)
Create a new PieItem, providing a gradient fill for the pie color.
Declaration
public PieItem(double pieValue, Color color1, Color color2, float fillAngle, double displacement, string label)
Parameters
Type | Name | Description |
---|---|---|
Double | pieValue | The value associated with this PieItem instance. |
Color | color1 | The starting display color for the gradient Fill for this PieItem instance. |
Color | color2 | The ending display color for the gradient Fill for this PieItem instance. |
Single | fillAngle | The angle for the gradient Fill. |
Double | displacement | The amount this PieItem instance will be displaced from the center point. |
String | label | Text label for this PieItem instance. |
PieItem(Double, String)
Create a new PieItem.
Declaration
public PieItem(double pieValue, string label)
Parameters
Type | Name | Description |
---|---|---|
Double | pieValue | The value associated with this PieItem instance. |
String | label | Text label for this PieItem instance |
PieItem(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected PieItem(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
PieItem(PieItem)
The Copy Constructor
Declaration
public PieItem(PieItem rhs)
Parameters
Type | Name | Description |
---|---|---|
PieItem | rhs | The PieItem object from which to copy |
Fields
| Improve this Doc View Sourceschema2
Current schema value that defines the version of the serialized file
Declaration
public const int schema2 = 10
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBorder
Gets or sets the Border object so as to be able to modify its properties.
Declaration
public Border Border { get; set; }
Property Value
Type | Description |
---|---|
Border |
Displacement
Gets or sets the a value which determines the amount, if any, of this PieItem
displacement.
Declaration
public double Displacement { get; set; }
Property Value
Type | Description |
---|---|
Double |
Fill
Gets or sets the Fill object which is used to fill the pie slice with color.
Declaration
public Fill Fill { get; set; }
Property Value
Type | Description |
---|---|
Fill |
LabelDetail
Declaration
public TextObj LabelDetail { get; set; }
Property Value
Type | Description |
---|---|
TextObj |
LabelType
Gets or sets the PieLabelType to be used in displaying PieItem labels.
Declaration
public PieLabelType LabelType { get; set; }
Property Value
Type | Description |
---|---|
PieLabelType |
PercentDecimalDigits
Gets or sets the number of decimal digits to be displayed in a PieItem percent label.
Declaration
public int PercentDecimalDigits { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SlicePath
Gets a path representing this PieItem
Declaration
public GraphicsPath SlicePath { get; }
Property Value
Type | Description |
---|---|
GraphicsPath |
Value
Gets or sets the value of this PieItem.
Minimum value is 0.
Declaration
public double Value { get; set; }
Property Value
Type | Description |
---|---|
Double |
ValueDecimalDigits
Gets or sets the number of decimal digits to be displayed in a PieItem value label.
Declaration
public int ValueDecimalDigits { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceCalcPieRect(Graphics, GraphPane, Single, RectangleF)
Calculate the RectangleF that will be used to define the bounding rectangle of the Pie.
Declaration
public static RectangleF CalcPieRect(Graphics g, GraphPane pane, float scaleFactor, RectangleF chartRect)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A reference to the GraphPane object that is the parent or owner of this object. |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
RectangleF | chartRect | The RectangleF (normally the Rect) that bounds this pie. |
Returns
Type | Description |
---|---|
RectangleF |
Remarks
This rectangle always lies inside of the Rect, and it is normally a square so that the pie itself is not oval-shaped.
Clone()
Typesafe, deep-copy clone method.
Declaration
public PieItem Clone()
Returns
Type | Description |
---|---|
PieItem | A new, independent copy of this class |
DesignLabel(Graphics, GraphPane, RectangleF, Single)
This method collects all the data relative to rendering this PieItem's label.
Declaration
public void DesignLabel(Graphics g, GraphPane pane, RectangleF rect, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
RectangleF | rect | The rectangle used for rendering this PieItem |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
Draw(Graphics, GraphPane, Int32, Single)
Do all rendering associated with this PieItem item to the specified Graphics device. This method is normally only called by the Draw method of the parent CurveList collection object.
Declaration
public override void Draw(Graphics g, GraphPane pane, int pos, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A reference to the GraphPane object that is the parent or owner of this object. |
Int32 | pos | Not used for rendering Pies |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
Overrides
| Improve this Doc View SourceDrawLabel(Graphics, GraphPane, RectangleF, Single)
Render the label for this PieItem.
Declaration
public void DrawLabel(Graphics g, GraphPane pane, RectangleF rect, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
RectangleF | rect | Bounding rectangle for this PieItem. |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
DrawLegendKey(Graphics, GraphPane, RectangleF, Single)
Draw a legend key entry for this PieItem at the specified location
Declaration
public override void DrawLegendKey(Graphics g, GraphPane pane, RectangleF rect, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A reference to the GraphPane object that is the parent or owner of this object. |
RectangleF | rect | The RectangleF struct that specifies the location for the legend key |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
Overrides
| Improve this Doc View SourceGetCoords(GraphPane, Int32, out String)
Determine the coords for the rectangle associated with a specified point for this CurveItem
Declaration
public override bool GetCoords(GraphPane pane, int i, out string coords)
Parameters
Type | Name | Description |
---|---|---|
GraphPane | pane | The GraphPane to which this curve belongs |
Int32 | i | The index of the point of interest |
String | coords | A list of coordinates that represents the "rect" for this point (used in an html AREA tag) |
Returns
Type | Description |
---|---|
Boolean | true if it's a valid point, false otherwise |
Overrides
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo instance with the data needed to serialize the target object
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |