Search Results for

    Show / Hide Table of Contents

    Class Bar

    A class representing all the characteristics of the bar segments that make up a curve on the graph.

    Inheritance
    System.Object
    Bar
    Implements
    System.ICloneable
    System.Runtime.Serialization.ISerializable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ZedGraph
    Assembly: ZedGraph.dll
    Syntax
    [Serializable]
    public class Bar : ICloneable, ISerializable

    Constructors

    | Improve this Doc View Source

    Bar()

    Default constructor that sets all Bar properties to default values as defined in the Bar.Default class.

    Declaration
    public Bar()
    | Improve this Doc View Source

    Bar(Color)

    Default constructor that sets the System.Drawing.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
    System.Drawing.Color color

    A System.Drawing.Color value indicating the Color of the Bar.

    | Improve this Doc View Source

    Bar(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected Bar(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A System.Runtime.Serialization.SerializationInfo instance that defines the serialized data

    System.Runtime.Serialization.StreamingContext context

    A System.Runtime.Serialization.StreamingContext instance that contains the serialized data

    | Improve this Doc View Source

    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 Source

    schema

    Current schema value that defines the version of the serialized file

    Declaration
    public const int schema = 10
    Field Value
    Type Description
    System.Int32

    Properties

    | Improve this Doc View Source

    Border

    The Border object used to draw the border around the Bar.

    Declaration
    public Border Border { get; set; }
    Property Value
    Type Description
    Border
    See Also
    IsBorderVisible
    BorderWidth
    BorderColor
    | Improve this Doc View Source

    Fill

    Gets or sets the Fill data for this Bar.

    Declaration
    public Fill Fill { get; set; }
    Property Value
    Type Description
    Fill

    Methods

    | Improve this Doc View Source

    Clone()

    Typesafe, deep-copy clone method.

    Declaration
    public Bar Clone()
    Returns
    Type Description
    Bar

    A new, independent copy of this class

    | Improve this Doc View Source

    Draw(Graphics, GraphPane, RectangleF, Single, Boolean, Boolean, PointPair)

    Draw the Bar to the specified System.Drawing.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
    System.Drawing.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.

    System.Drawing.RectangleF rect

    The rectangle (pixels) to contain the bar

    System.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.

    System.Boolean fullFrame

    true to draw the bottom portion of the border around the bar (this is for legend entries)

    System.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.

    | Improve this Doc View Source

    Draw(Graphics, GraphPane, Single, Single, Single, Single, Single, Boolean, Boolean, PointPair)

    Draw the Bar to the specified System.Drawing.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
    System.Drawing.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.

    System.Single left

    The x position of the left side of the bar in pixel units

    System.Single right

    The x position of the right side of the bar in pixel units

    System.Single top

    The y position of the top of the bar in pixel units

    System.Single bottom

    The y position of the bottom of the bar in pixel units

    System.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.

    System.Boolean fullFrame

    true to draw the bottom portion of the border around the bar (this is for legend entries)

    System.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.

    | Improve this Doc View Source

    DrawBars(Graphics, GraphPane, CurveItem, Axis, Axis, Single, Int32, Single)

    Draw the this Bar to the specified System.Drawing.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
    System.Drawing.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

    A CurveItem object representing the Bar's to be drawn.

    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

    System.Single barWidth

    The width of each bar, in pixels.

    System.Int32 pos

    The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) in the cluster of bars.

    System.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.

    | Improve this Doc View Source

    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 System.Drawing.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
    System.Drawing.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

    A CurveItem object representing the Bar's to be drawn.

    System.Int32 index

    The zero-based index number for the single bar to be drawn.

    System.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

    System.Single barWidth

    The width of each bar, in pixels.

    System.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.

    | Improve this Doc View Source

    DrawSingleBar(Graphics, GraphPane, CurveItem, Axis, Axis, Int32, Int32, Single, Single)

    Draw the specified single bar (an individual "point") of this series to the specified System.Drawing.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
    System.Drawing.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

    A CurveItem object representing the Bar's to be drawn.

    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

    System.Int32 pos

    The ordinal position of the this bar series (0=first bar, 1=second bar, etc.) in the cluster of bars.

    System.Int32 index

    The zero-based index number for the single bar to be drawn.

    System.Single barWidth

    The width of each bar, in pixels.

    System.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.

    | Improve this Doc View Source

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a System.Runtime.Serialization.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
    System.Runtime.Serialization.SerializationInfo info

    A System.Runtime.Serialization.SerializationInfo instance that defines the serialized data

    System.Runtime.Serialization.StreamingContext context

    A System.Runtime.Serialization.StreamingContext instance that contains the serialized data

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICloneable.Clone()

    Implement the System.ICloneable interface in a typesafe manner by just calling the typed version of Clone()

    Declaration
    object ICloneable.Clone()
    Returns
    Type Description
    System.Object

    A deep copy of this object

    Implements

    System.ICloneable
    System.Runtime.Serialization.ISerializable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX