Search Results for

    Show / Hide Table of Contents

    Class ValueHandler

    A class designed to simplify the process of getting the actual value for the various stacked and regular curve types

    Inheritance
    Object
    ValueHandler
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: ZedGraph
    Assembly: ZedGraph.dll
    Syntax
    public class ValueHandler

    Constructors

    | Improve this Doc View Source

    ValueHandler(GraphPane, Boolean)

    Basic constructor that saves a reference to the parent GraphPane object.

    Declaration
    public ValueHandler(GraphPane pane, bool initialize)
    Parameters
    Type Name Description
    GraphPane pane

    The parent GraphPane object.

    Boolean initialize

    A Boolean flag to indicate whether or not the drawing variables should be initialized. Initialization is not required if this is part of a ZedGraph internal draw operation (i.e., its in the middle of a call to Draw(Graphics)). Otherwise, you should initialize to make sure the drawing variables are configured. true to do an initialization, false otherwise.

    Methods

    | Improve this Doc View Source

    BarCenterValue(CurveItem, Single, Int32, Double, Int32)

    Calculate the user scale position of the center of the specified bar, using the Axis as specified by Base. This method is used primarily by the FindNearestPoint(PointF, out CurveItem, out Int32) method in order to determine the bar "location," which is defined as the center of the top of the individual bar.

    Declaration
    public double BarCenterValue(CurveItem curve, float barWidth, int iCluster, double val, int iOrdinal)
    Parameters
    Type Name Description
    CurveItem curve

    The CurveItem representing the bar of interest.

    Single barWidth

    The width of each individual bar. This can be calculated using the GetBarWidth(GraphPane) method.

    Int32 iCluster

    The cluster number for the bar of interest. This is the ordinal position of the current point. That is, if a particular CurveItem has 10 points, then a value of 3 would indicate the 4th point in the data array.

    Double val

    The actual independent axis value for the bar of interest.

    Int32 iOrdinal

    The ordinal position of the CurveItem of interest. That is, the first bar series is 0, the second is 1, etc. Note that this applies only to the bars. If a graph includes both bars and lines, then count only the bars.

    Returns
    Type Description
    Double

    A user scale value position of the center of the bar of interest.

    | Improve this Doc View Source

    GetValues(CurveItem, Int32, out Double, out Double, out Double)

    Get the user scale values associate with a particular point of a particular curve.

    Declaration
    public bool GetValues(CurveItem curve, int iPt, out double baseVal, out double lowVal, out double hiVal)
    Parameters
    Type Name Description
    CurveItem curve

    A CurveItem object of interest.

    Int32 iPt

    The zero-based point index for the point of interest.

    Double baseVal

    A Double value representing the value for the independent axis.

    Double lowVal

    A Double value representing the lower value for the dependent axis.

    Double hiVal

    A Double value representing the upper value for the dependent axis.

    Returns
    Type Description
    Boolean

    true if the data point is value, false for Missing, invalid, etc. data.

    Remarks

    The main purpose of this method is to handle stacked bars, in which case the stacked values are returned rather than the individual data values.

    | Improve this Doc View Source

    GetValues(GraphPane, CurveItem, Int32, out Double, out Double, out Double)

    Get the user scale values associate with a particular point of a particular curve.

    Declaration
    public static bool GetValues(GraphPane pane, CurveItem curve, int iPt, out double baseVal, out double lowVal, out double hiVal)
    Parameters
    Type Name Description
    GraphPane pane

    The parent GraphPane object.

    CurveItem curve

    A CurveItem object of interest.

    Int32 iPt

    The zero-based point index for the point of interest.

    Double baseVal

    A Double value representing the value for the independent axis.

    Double lowVal

    A Double value representing the lower value for the dependent axis.

    Double hiVal

    A Double value representing the upper value for the dependent axis.

    Returns
    Type Description
    Boolean

    true if the data point is value, false for Missing, invalid, etc. data.

    Remarks

    The main purpose of this method is to handle stacked bars and lines, in which case the stacked values are returned rather than the individual data values. However, this method works generically for any curve type.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX