Class Bar
A class representing all the characteristics of the bar segments that make up a curve on the graph.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class Bar : ICloneable, ISerializable
Constructors
| Improve this Doc View SourceBar()
Default constructor that sets all Bar properties to default values as defined in the Bar.Default class.
Declaration
public Bar()
Bar(Color)
Default constructor that sets the Color as specified, and the remaining Bar properties to default values as defined in the Bar.Default class. The specified color is only applied to the Color, and the Color will be defaulted.
Declaration
public Bar(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color |
Bar(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected Bar(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 |
Bar(Bar)
The Copy Constructor
Declaration
public Bar(Bar rhs)
Parameters
Type | Name | Description |
---|---|---|
Bar | rhs | The Bar object from which to copy |
Fields
| Improve this Doc View Sourceschema
Current schema value that defines the version of the serialized file
Declaration
public const int schema = 10
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBorder
Declaration
public Border Border { get; set; }
Property Value
Type | Description |
---|---|
Border |
See Also
| Improve this Doc View SourceFill
Declaration
public Fill Fill { get; set; }
Property Value
Type | Description |
---|---|
Fill |
Methods
| Improve this Doc View SourceClone()
Typesafe, deep-copy clone method.
Declaration
public Bar Clone()
Returns
Type | Description |
---|---|
Bar | A new, independent copy of this class |
Draw(Graphics, GraphPane, RectangleF, Single, Boolean, Boolean, PointPair)
Draw the Bar to the specified Graphics device at the specified location. This routine draws a single bar.
Declaration
public void Draw(Graphics g, GraphPane pane, RectangleF rect, float scaleFactor, bool fullFrame, bool isSelected, PointPair dataValue)
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 rectangle (pixels) to contain the bar |
Single | scaleFactor | The scaling factor for the features of the graph based on the BaseDimension. This scaling factor is calculated by the CalcScaleFactor() method. The scale factor represents a linear multiple to be applied to font sizes, symbol sizes, etc. |
Boolean | fullFrame | true to draw the bottom portion of the border around the bar (this is for legend entries) |
Boolean | isSelected | Indicates that the Bar should be drawn with attributes from the Selection class. |
PointPair | dataValue | The data value to be used for a value-based color gradient. This is only applicable for GradientByX, GradientByY or GradientByZ. |
Draw(Graphics, GraphPane, Single, Single, Single, Single, Single, Boolean, Boolean, PointPair)
Draw the Bar to the specified Graphics device at the specified location. This routine draws a single bar.
Declaration
public void Draw(Graphics g, GraphPane pane, float left, float right, float top, float bottom, float scaleFactor, bool fullFrame, bool isSelected, PointPair dataValue)
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 | left | The x position of the left side of the bar in pixel units |
Single | right | The x position of the right side of the bar in pixel units |
Single | top | The y position of the top of the bar in pixel units |
Single | bottom | The y position of the bottom of the bar in pixel units |
Single | scaleFactor | The scaling factor for the features of the graph based on the BaseDimension. This scaling factor is calculated by the CalcScaleFactor() method. The scale factor represents a linear multiple to be applied to font sizes, symbol sizes, etc. |
Boolean | fullFrame | true to draw the bottom portion of the border around the bar (this is for legend entries) |
Boolean | isSelected | Indicates that the Bar should be drawn with attributes from the Selection class. |
PointPair | dataValue | The data value to be used for a value-based color gradient. This is only applicable for GradientByX, GradientByY or GradientByZ. |
DrawBars(Graphics, GraphPane, CurveItem, Axis, Axis, Single, Int32, Single)
Draw the this Bar to the specified Graphics device as a bar at each defined point. This method is normally only called by the Draw(Graphics, GraphPane, Int32, Single) method of the BarItem object
Declaration
public void DrawBars(Graphics g, GraphPane pane, CurveItem curve, Axis baseAxis, Axis valueAxis, float barWidth, 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. |
CurveItem | curve | |
Axis | baseAxis | The Axis class instance that defines the base (independent) axis for the Bar |
Axis | valueAxis | The Axis class instance that defines the value (dependent) axis for the Bar |
Single | barWidth | The width of each bar, in pixels. |
Int32 | pos | The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) in the cluster of bars. |
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. |
DrawSingleBar(Graphics, GraphPane, CurveItem, Int32, Int32, Axis, Axis, Single, Single)
Protected internal routine that draws the specified single bar (an individual "point") of this series to the specified Graphics device.
Declaration
protected virtual void DrawSingleBar(Graphics g, GraphPane pane, CurveItem curve, int index, int pos, Axis baseAxis, Axis valueAxis, float barWidth, 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. |
CurveItem | curve | |
Int32 | index | The zero-based index number for the single bar to be drawn. |
Int32 | pos | The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) in the cluster of bars. |
Axis | baseAxis | The Axis class instance that defines the base (independent) axis for the Bar |
Axis | valueAxis | The Axis class instance that defines the value (dependent) axis for the Bar |
Single | barWidth | The width of each bar, in pixels. |
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. |
DrawSingleBar(Graphics, GraphPane, CurveItem, Axis, Axis, Int32, Int32, Single, Single)
Draw the specified single bar (an individual "point") of this series to the specified Graphics device. This method is not as efficient as DrawBars(Graphics, GraphPane, CurveItem, Axis, Axis, Single, Int32, Single), which draws the bars for all points. It is intended to be used only for SortedOverlay, which requires special handling of each bar.
Declaration
public void DrawSingleBar(Graphics g, GraphPane pane, CurveItem curve, Axis baseAxis, Axis valueAxis, int pos, int index, float barWidth, 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. |
CurveItem | curve | |
Axis | baseAxis | The Axis class instance that defines the base (independent) axis for the Bar |
Axis | valueAxis | The Axis class instance that defines the value (dependent) axis for the Bar |
Int32 | pos | The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) in the cluster of bars. |
Int32 | index | The zero-based index number for the single bar to be drawn. |
Single | barWidth | The width of each bar, in pixels. |
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. |
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo instance with the data needed to serialize the target object
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public virtual 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 |
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 |