Search Results for

    Show / Hide Table of Contents

    Class Scale

    The Scale class is an abstract base class that encompasses the properties and methods associated with a scale of data.

    Inheritance
    Object
    Scale
    Implements
    ISerializable
    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
    [Serializable]
    public abstract class Scale : ISerializable
    Remarks

    This class is inherited by the ZedGraph.LinearScale, ZedGraph.LogScale, ZedGraph.OrdinalScale, ZedGraph.TextScale, ZedGraph.DateScale, ZedGraph.ExponentScale, ZedGraph.DateAsOrdinalScale, and ZedGraph.LinearAsOrdinalScale classes to define specific characteristics for those types.

    Constructors

    | Improve this Doc View Source

    Scale(SerializationInfo, StreamingContext)

    Constructor for deserializing objects

    Declaration
    protected Scale(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

    | Improve this Doc View Source

    Scale(Axis)

    Basic constructor -- requires that the Scale object be intialized with a pre-existing owner Axis.

    Declaration
    public Scale(Axis ownerAxis)
    Parameters
    Type Name Description
    Axis ownerAxis

    The Axis object that is the owner of this Scale instance.

    | Improve this Doc View Source

    Scale(Scale, Axis)

    Copy Constructor. Create a new Scale object based on the specified existing one.

    Declaration
    public Scale(Scale rhs, Axis owner)
    Parameters
    Type Name Description
    Scale rhs

    The Scale object to be copied.

    Axis owner

    The Axis object that will own the new instance of Scale

    Fields

    | Improve this Doc View Source

    schema

    Current schema value that defines the version of the serialized file

    Declaration
    public const int schema = 11
    Field Value
    Type Description
    Int32

    Properties

    | Improve this Doc View Source

    Align

    Controls the alignment of the Axis tic labels.

    Declaration
    public AlignP Align { get; set; }
    Property Value
    Type Description
    AlignP
    Remarks

    This property controls whether the inside, center, or outside edges of the text labels are aligned.

    | Improve this Doc View Source

    AlignH

    Controls the alignment of the Axis tic labels.

    Declaration
    public AlignH AlignH { get; set; }
    Property Value
    Type Description
    AlignH
    Remarks

    This property controls whether the left, center, or right edges of the text labels are aligned.

    | Improve this Doc View Source

    BaseTic

    Gets or sets the scale value at which the first major tic label will appear.

    Declaration
    public double BaseTic { get; set; }
    Property Value
    Type Description
    Double

    The value is defined in user scale units

    Remarks

    This property allows the scale labels to start at an irregular value. For example, on a scale range with Min = 0, Max = 1000, and MajorStep = 200, a BaseTic value of 50 would cause the scale labels to appear at values 50, 250, 450, 650, and 850. Note that the default value for this property is Missing, which means the value is not used. Setting this property to any value other than Missing will activate the effect. The value specified must coincide with the first major tic. That is, if BaseTic were set to 650 in the example above, then the major tics would only occur at 650 and 850. This setting may affect the minor tics, since the minor tics are always referenced to the BaseTic. That is, in the example above, if the MinorStep were set to 30 (making it a non-multiple of the major step), then the minor tics would occur at 20, 50 (so it lines up with the BaseTic), 80, 110, 140, etc.

    See Also
    Min
    Max
    MajorStep
    MinorStep
    Cross
    | Improve this Doc View Source

    Exponent

    Gets or sets the scale exponent value. This only applies to Exponent.

    Declaration
    public double Exponent { get; set; }
    Property Value
    Type Description
    Double
    See Also
    Min
    Max
    MinorStep
    MajorStepAuto
    TargetXSteps
    TargetYSteps
    ZeroLever
    MaxTextLabels
    | Improve this Doc View Source

    FontSpec

    Gets a reference to the FontSpec class used to render the scale values

    Declaration
    public FontSpec FontSpec { get; set; }
    Property Value
    Type Description
    FontSpec
    See Also
    FontFamily
    FontSize
    FontColor
    FontBold
    FontUnderline
    FontItalic
    | Improve this Doc View Source

    Format

    The format of the Axis tic labels.

    Declaration
    public string Format { get; set; }
    Property Value
    Type Description
    String

    The format string conforms to the DateTimeFormatInfo for date formats, and NumberFormatInfo for numeric formats.

    Remarks

    This property may be a date format or a numeric format, depending on the setting of Type. This property may be set automatically by ZedGraph, depending on the state of FormatAuto.

    See Also
    Mag
    FormatAuto
    FontSpec
    | Improve this Doc View Source

    FormatAuto

    Determines whether or not the scale label format Format is determined automatically based on the range of data values.

    Declaration
    public bool FormatAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true if Format will be set automatically, false if it is to be set manually by the user

    Remarks

    This value will be set to false if Format is manually changed.

    See Also
    Mag
    Format
    FontSpec
    | Improve this Doc View Source

    IsAnyOrdinal

    Gets a value that indicates if this Scale is of any of the ordinal types in the AxisType enumeration.

    Declaration
    public bool IsAnyOrdinal { get; }
    Property Value
    Type Description
    Boolean
    See Also
    Type
    | Improve this Doc View Source

    IsDate

    True if this scale is Date, false otherwise.

    Declaration
    public bool IsDate { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsExponent

    True if this scale is Exponent, false otherwise.

    Declaration
    public bool IsExponent { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsLabelsInside

    Gets or sets a value that causes the axis scale labels and title to appear on the opposite side of the axis.

    Declaration
    public bool IsLabelsInside { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    For example, setting this flag to true for the YAxis will shift the axis labels and title to the right side of the YAxis instead of the normal left-side location. Set this property to true for the XAxis, and set the Cross property for the XAxis to an arbitrarily large value (assuming IsReverse is false for the YAxis) in order to have the XAxis appear at the top of the Rect.

    See Also
    IsReverse
    Cross
    | Improve this Doc View Source

    IsLog

    True if this scale is Log, false otherwise.

    Declaration
    public bool IsLog { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsOrdinal

    True if this scale is Ordinal, false otherwise.

    Declaration
    public bool IsOrdinal { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    Note that this is only true for an actual ZedGraph.OrdinalScale class. This property will be false for other ordinal types such as Text, LinearAsOrdinal, or DateAsOrdinal. Use the IsAnyOrdinal as a "catchall" for all ordinal type axes.

    | Improve this Doc View Source

    IsPreventLabelOverlap

    Gets or sets a Boolean value that determines if ZedGraph will check to see if the Axis scale labels are close enough to overlap. If so, ZedGraph will adjust the step size to prevent overlap.

    Declaration
    public bool IsPreventLabelOverlap { get; set; }
    Property Value
    Type Description
    Boolean

    boolean value; true to check for overlap, false otherwise

    Remarks

    The process of checking for overlap is done during the AxisChange() method call, and affects the selection of the major step size (MajorStep).

    | Improve this Doc View Source

    IsReverse

    Determines if the scale values are reversed for this Axis

    Declaration
    public bool IsReverse { get; set; }
    Property Value
    Type Description
    Boolean

    true for the X values to decrease to the right or the Y values to decrease upwards, false otherwise

    See Also
    IsReverse
    | Improve this Doc View Source

    IsSkipCrossLabel

    Gets or sets a value that causes the scale label that is located at the Cross value for this Axis to be hidden.

    Declaration
    public bool IsSkipCrossLabel { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    For axes that have an active Cross setting (e.g., CrossAuto is false), the scale label at the Cross value is overlapped by opposing axes. Use this property to hide the scale label to avoid the overlap.

    | Improve this Doc View Source

    IsSkipFirstLabel

    Gets or sets a value that causes the first scale label for this Axis to be hidden.

    Declaration
    public bool IsSkipFirstLabel { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Often, for axis that have an active Cross setting (e.g., CrossAuto is false), the first and/or last scale label are overlapped by opposing axes. Use this property to hide the first scale label to avoid the overlap. Note that setting this value to true will hide any scale label that appears within EdgeTolerance of the beginning of the Axis.

    | Improve this Doc View Source

    IsSkipLastLabel

    Gets or sets a value that causes the last scale label for this Axis to be hidden.

    Declaration
    public bool IsSkipLastLabel { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Often, for axis that have an active Cross setting (e.g., CrossAuto is false), the first and/or last scale label are overlapped by opposing axes. Use this property to hide the last scale label to avoid the overlap. Note that setting this value to true will hide any scale label that appears within EdgeTolerance of the end of the Axis.

    | Improve this Doc View Source

    IsText

    True if this scale is Text, false otherwise.

    Declaration
    public bool IsText { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsUseTenPower

    Determines if powers-of-ten notation will be used for the numeric value labels.

    Declaration
    public bool IsUseTenPower { get; set; }
    Property Value
    Type Description
    Boolean

    boolean value; true to show the title as a power of ten, false to show a regular numeric value (e.g., "0.01", "10", "1000")

    Remarks

    The powers-of-ten notation is just the text "10" followed by a superscripted value indicating the magnitude. This mode is only valid for log scales (see IsLog and Type).

    | Improve this Doc View Source

    IsVisible

    Gets or sets a property that determines whether or not the scale values will be shown.

    Declaration
    public bool IsVisible { get; set; }
    Property Value
    Type Description
    Boolean

    true to show the scale values, false otherwise

    See Also
    IsVisible
    | Improve this Doc View Source

    LabelGap

    The gap between the scale labels and the tics.

    Declaration
    public float LabelGap { get; set; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Mag

    The magnitude multiplier for scale values.

    Declaration
    public int Mag { get; set; }
    Property Value
    Type Description
    Int32

    The magnitude multiplier (power of 10) for the scale value labels

    Remarks

    This is used to limit the size of the displayed value labels. For example, if the value is really 2000000, then the graph will display 2000 with a 10^3 magnitude multiplier. This value can be determined automatically depending on the state of MagAuto. If this value is set manually by the user, then MagAuto will also be set to false.

    See Also
    IsOmitMag
    Title
    Format
    FontSpec
    | Improve this Doc View Source

    MagAuto

    Determines whether the Mag value will be set automatically based on the data, or manually by the user.

    Declaration
    public bool MagAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true to have Mag set automatically, false otherwise

    Remarks

    If the user manually sets the Mag value, then this flag will be set to false.

    See Also
    IsOmitMag
    Title
    Mag
    | Improve this Doc View Source

    MajorStep

    Gets or sets the scale step size for this Scale (the increment between labeled axis values).

    Declaration
    public double MajorStep { get; set; }
    Property Value
    Type Description
    Double

    The value is defined in user scale units

    Remarks

    This value can be set automatically based on the state of MajorStepAuto. If this value is set manually, then MajorStepAuto will also be set to false. This value is ignored for Log axes. For Date axes, this value is defined in units of MajorUnit.

    See Also
    Min
    Max
    MinorStep
    MajorStepAuto
    TargetXSteps
    TargetYSteps
    ZeroLever
    MaxTextLabels
    | Improve this Doc View Source

    MajorStepAuto

    Gets or sets a value that determines whether or not the scale step size MajorStep is set automatically.

    Declaration
    public bool MajorStepAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true for automatic mode, false for manual mode

    Remarks

    This value will be set to false if MajorStep is manually changed.

    See Also
    MajorStep
    | Improve this Doc View Source

    MajorUnit

    Gets or sets the type of units used for the major step size (MajorStep).

    Declaration
    public DateUnit MajorUnit { get; set; }
    Property Value
    Type Description
    DateUnit

    The value is a DateUnit enum type

    Remarks

    This unit type only applies to Date-Time axes (Date = true). The axis is set to date type with the Type property. The unit types are defined as DateUnit.

    See Also
    Min
    Max
    MajorStep
    MinorStep
    MajorStepAuto
    | Improve this Doc View Source

    Max

    Gets or sets the maximum scale value for this Scale.

    Declaration
    public virtual double Max { get; set; }
    Property Value
    Type Description
    Double

    The value is defined in user scale units for Log and Linear axes. For Text and Ordinal axes, this value is an ordinal starting with 1.0. For Date axes, this value is in XL Date format (see XDate, which is the number of days since the reference date of January 1, 1900.

    Remarks

    This value can be set automatically based on the state of MaxAuto. If this value is set manually, then MaxAuto will also be set to false.

    See Also
    Min
    MajorStep
    MinorStep
    MaxAuto
    | Improve this Doc View Source

    MaxAuto

    Gets or sets a value that determines whether or not the maximum scale value Max is set automatically.

    Declaration
    public bool MaxAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true for automatic mode, false for manual mode

    Remarks

    This value will be set to false if Max is manually changed.

    See Also
    Max
    | Improve this Doc View Source

    MaxGrace

    Gets or sets the "grace" value applied to the maximum data range.

    Declaration
    public double MaxGrace { get; set; }
    Property Value
    Type Description
    Double
    Remarks

    This values determines how much extra space is left after the last data value. This value is expressed as a fraction of the total data range. For example, assume the data range is from 4.0 to 16.0, leaving a range of 12.0. If MaxGrace is set to 0.1, then 10% of the range, or 1.2 will be added to the maximum data value. The scale will then be ranged to cover at least 4.0 to 17.2.

    See Also
    Max
    MaxGrace
    MinGrace
    | Improve this Doc View Source

    Min

    Gets or sets the minimum scale value for this Scale.

    Declaration
    public virtual double Min { get; set; }
    Property Value
    Type Description
    Double

    The value is defined in user scale units for Log and Linear axes. For Text and Ordinal axes, this value is an ordinal starting with 1.0. For Date axes, this value is in XL Date format (see XDate, which is the number of days since the reference date of January 1, 1900.

    Remarks

    This value can be set automatically based on the state of MinAuto. If this value is set manually, then MinAuto will also be set to false.

    See Also
    Max
    MajorStep
    MinorStep
    MinAuto
    | Improve this Doc View Source

    MinAuto

    Gets or sets a value that determines whether or not the minimum scale value Min is set automatically.

    Declaration
    public bool MinAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true for automatic mode, false for manual mode

    Remarks

    This value will be set to false if Min is manually changed.

    See Also
    Min
    | Improve this Doc View Source

    MinGrace

    Gets or sets the "grace" value applied to the minimum data range.

    Declaration
    public double MinGrace { get; set; }
    Property Value
    Type Description
    Double
    Remarks

    This value is expressed as a fraction of the total data range. For example, assume the data range is from 4.0 to 16.0, leaving a range of 12.0. If MinGrace is set to 0.1, then 10% of the range, or 1.2 will be subtracted from the minimum data value. The scale will then be ranged to cover at least 2.8 to 16.0.

    See Also
    Min
    MinGrace
    MaxGrace
    | Improve this Doc View Source

    MinorStep

    Gets or sets the scale minor step size for this Scale (the spacing between minor tics).

    Declaration
    public double MinorStep { get; set; }
    Property Value
    Type Description
    Double

    The value is defined in user scale units

    Remarks

    This value can be set automatically based on the state of MinorStepAuto. If this value is set manually, then MinorStepAuto will also be set to false. This value is ignored for Log and Text axes. For Date axes, this value is defined in units of MinorUnit.

    See Also
    Min
    Max
    MajorStep
    MinorStepAuto
    | Improve this Doc View Source

    MinorStepAuto

    Gets or sets a value that determines whether or not the minor scale step size MinorStep is set automatically.

    Declaration
    public bool MinorStepAuto { get; set; }
    Property Value
    Type Description
    Boolean

    true for automatic mode, false for manual mode

    Remarks

    This value will be set to false if MinorStep is manually changed.

    See Also
    MinorStep
    | Improve this Doc View Source

    MinorUnit

    Gets or sets the type of units used for the minor step size (MinorStep).

    Declaration
    public DateUnit MinorUnit { get; set; }
    Property Value
    Type Description
    DateUnit

    The value is a DateUnit enum type

    Remarks

    This unit type only applies to Date-Time axes (Date = true). The axis is set to date type with the Type property. The unit types are defined as DateUnit.

    See Also
    Min
    Max
    MajorStep
    MinorStep
    MinorStepAuto
    | Improve this Doc View Source

    TextLabels

    The text labels for this Axis.

    Declaration
    public string[] TextLabels { get; set; }
    Property Value
    Type Description
    String[]
    Remarks

    This property is only applicable if Type is set to Text.

    | Improve this Doc View Source

    Type

    Get an AxisType enumeration that indicates the type of this scale.

    Declaration
    public abstract AxisType Type { get; }
    Property Value
    Type Description
    AxisType

    Methods

    | Improve this Doc View Source

    CalcBoundedStepSize(Double, Double)

    Calculate a step size based on a data range, limited to a maximum number of steps.

    Declaration
    protected double CalcBoundedStepSize(double range, double maxSteps)
    Parameters
    Type Name Description
    Double range

    The range of data in user scale units. This can be a full range of the data for the major step size, or just the value of the major step size to calculate the minor step size

    Double maxSteps

    The maximum allowable number of steps to divide the range into

    Returns
    Type Description
    Double

    The calculated step size for the specified data range.

    Remarks

    This utility method will calculate a step size, of no more than maxSteps, using a rational increment (1, 2, or 5 -- which are even divisors of 10). This method is used by PickScale(GraphPane, Graphics, Single).

    | Improve this Doc View Source

    CalcMaxLabels(Graphics, GraphPane, Single)

    Calculate the maximum number of labels that will fit on this axis.

    Declaration
    public int CalcMaxLabels(Graphics g, GraphPane pane, 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 associated with this Axis

    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.

    Returns
    Type Description
    Int32
    Remarks

    This method works for both X and Y direction axes, and it works for angled text (assuming that a bounding box is an appropriate measure). Technically, labels at 45 degree angles could fit better than the return value of this method since the bounding boxes can overlap without the labels actually overlapping.

    | Improve this Doc View Source

    CalcStepSize(Double, Double)

    Calculate a step size based on a data range.

    Declaration
    protected static double CalcStepSize(double range, double targetSteps)
    Parameters
    Type Name Description
    Double range

    The range of data in user scale units. This can be a full range of the data for the major step size, or just the value of the major step size to calculate the minor step size

    Double targetSteps

    The desired "typical" number of steps to divide the range into

    Returns
    Type Description
    Double

    The calculated step size for the specified data range.

    Remarks

    This utility method will try to honor the TargetXSteps and TargetYSteps number of steps while using a rational increment (1, 2, or 5 -- which are even divisors of 10). This method is used by PickScale(GraphPane, Graphics, Single).

    | Improve this Doc View Source

    CalculateScrollRange(Double, Boolean)

    Calculates the scroll range with the specified grace value.

    Declaration
    public ScrollRange CalculateScrollRange(double grace, bool isScrollable)
    Parameters
    Type Name Description
    Double grace

    The grace or margin percentage to apply to the scale's range.

    Boolean isScrollable

    The desired IsScrollable value.

    Returns
    Type Description
    ScrollRange

    The ScrollRange value.

    | Improve this Doc View Source

    Clone(Axis)

    Create a new clone of the current item, with a new owner assignment

    Declaration
    public abstract Scale Clone(Axis owner)
    Parameters
    Type Name Description
    Axis owner

    The new Axis instance that will be the owner of the new Scale

    Returns
    Type Description
    Scale

    A new Scale clone.

    | Improve this Doc View Source

    DeLinearize(Double)

    Convert a value from its linear equivalent to its actual scale value for this type of scale.

    Declaration
    public virtual double DeLinearize(double val)
    Parameters
    Type Name Description
    Double val

    The value to be converted

    Returns
    Type Description
    Double
    Remarks

    The default behavior is to just return the value unchanged. However, for Log and Exponent, it returns the anti-log or inverse-power equivalent.

    | Improve this Doc View Source

    GetClusterWidth(Double)

    Calculates the cluster width, in pixels, by transforming the specified clusterScaleWidth.

    Declaration
    public float GetClusterWidth(double clusterScaleWidth)
    Parameters
    Type Name Description
    Double clusterScaleWidth

    The width in user scale units of each bar cluster

    Returns
    Type Description
    Single

    The equivalent pixel size of the bar cluster

    | Improve this Doc View Source

    GetClusterWidth(GraphPane)

    Determine the width, in pixel units, of each bar cluster including the cluster gaps and bar gaps.

    Declaration
    public float GetClusterWidth(GraphPane pane)
    Parameters
    Type Name Description
    GraphPane pane

    A reference to the GraphPane object associated with this Axis

    Returns
    Type Description
    Single

    The width of each bar cluster, in pixel units

    Remarks

    This method uses the ClusterScaleWidth for non-ordinal axes, or a cluster width of 1.0 for ordinal axes.

    | Improve this Doc View Source

    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

    Remarks

    You MUST set the _ownerAxis property after deserializing a BarSettings object.

    | Improve this Doc View Source

    Linearize(Double)

    Convert a value to its linear equivalent for this type of scale.

    Declaration
    public virtual double Linearize(double val)
    Parameters
    Type Name Description
    Double val

    The value to be converted

    Returns
    Type Description
    Double
    Remarks

    The default behavior is to just return the value unchanged. However, for Log and Exponent, it returns the log or power equivalent.

    | Improve this Doc View Source

    LocalTransform(Double)

    Transform the coordinate value from user coordinates (scale value) to graphics device coordinates (pixels).

    Declaration
    public float LocalTransform(double x)
    Parameters
    Type Name Description
    Double x

    The coordinate value, in linearized user scale units, to be transformed

    Returns
    Type Description
    Single

    the coordinate value transformed to screen coordinates for use in calling the ZedGraph.Scale.Draw(System.Drawing.Graphics,ZedGraph.GraphPane,System.Single,System.Single) method

    Remarks

    Assumes that the origin has been set to the "left" of this axis, facing from the label side. Note that the left side corresponds to the scale minimum for the X and Y2 axes, but it is the scale maximum for the Y axis. This method takes into account the scale range (Min and Max), logarithmic state (IsLog), scale reverse state (IsReverse) and axis type (XAxis, YAxis, or Y2Axis). Note that the Rect must be valid, and SetupScaleData(GraphPane, Axis) must be called for the current configuration before using this method.

    | Improve this Doc View Source

    MakeNewScale(Scale, AxisType)

    A construction method that creates a new Scale object using the properties of an existing Scale object, but specifying a new AxisType.

    Declaration
    public Scale MakeNewScale(Scale oldScale, AxisType type)
    Parameters
    Type Name Description
    Scale oldScale

    The existing Scale object from which to copy the field data.

    AxisType type

    An AxisType representing the type of derived type of new Scale object to create.

    Returns
    Type Description
    Scale

    The new Scale object.

    Remarks

    This constructor is used to change the type of an existing Axis. By specifying the old Scale object, you are giving a set of properties (which encompasses all fields associated with the scale, since the derived types have no fields) to be used in creating a new Scale object, only this time having the newly specified object type.

    | Improve this Doc View Source

    MyMod(Double, Double)

    Calculate the modulus (remainder) in a safe manner so that divide by zero errors are avoided

    Declaration
    protected double MyMod(double x, double y)
    Parameters
    Type Name Description
    Double x

    The divisor

    Double y

    The dividend

    Returns
    Type Description
    Double

    the value of the modulus, or zero for the divide-by-zero case

    | Improve this Doc View Source

    Pan(Double, Double)

    Pan the scale given the current and destination values.

    Declaration
    public void Pan(double value, double toValue)
    Parameters
    Type Name Description
    Double value

    The value to pan.

    Double toValue

    The end value.

    | Improve this Doc View Source

    PickScale(GraphPane, Graphics, Single)

    Select a reasonable scale given a range of data values.

    Declaration
    public virtual void PickScale(GraphPane pane, Graphics g, float scaleFactor)
    Parameters
    Type Name Description
    GraphPane pane

    A reference to the GraphPane object associated with this Axis

    Graphics g

    A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method.

    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.

    Remarks

    The scale range is chosen based on increments of 1, 2, or 5 (because they are even divisors of 10). This routine honors the MinAuto, MaxAuto, and MajorStepAuto autorange settings as well as the IsLog setting. In the event that any of the autorange settings are false, the corresponding Min, Max, or MajorStep setting is explicitly honored, and the remaining autorange settings (if any) will be calculated to accomodate the non-autoranged values. The basic defaults for scale selection are defined using ZeroLever, TargetXSteps, and TargetYSteps from the Scale.Default default class.

    On Exit:

    Min is set to scale minimum (if MinAuto = true)

    Max is set to scale maximum (if MaxAuto = true)

    MajorStep is set to scale step size (if MajorStepAuto = true)

    MinorStep is set to scale minor step size (if MinorStepAuto = true)

    Mag is set to a magnitude multiplier according to the data

    Format is set to the display format for the values (this controls the number of decimal places, whether there are thousands separators, currency types, etc.)

    | Improve this Doc View Source

    ReverseTransform(Single)

    Reverse transform the user coordinates (scale value) given a graphics device coordinate (pixels).

    Declaration
    public double ReverseTransform(float pixVal)
    Parameters
    Type Name Description
    Single pixVal

    The screen pixel value, in graphics device coordinates to be transformed

    Returns
    Type Description
    Double

    The user scale value that corresponds to the screen pixel location

    Remarks

    This method takes into account the scale range (Min and Max), logarithmic state (IsLog), scale reverse state (IsReverse) and axis type (XAxis, YAxis, or Y2Axis). Note that the Rect must be valid, and SetupScaleData(GraphPane, Axis) must be called for the current configuration before using this method (this is called everytime the graph is drawn (i.e., Draw(Graphics) is called).

    | Improve this Doc View Source

    SafeExp(Double, Double)

    Calculate an exponential in a safe manner to avoid math exceptions

    Declaration
    public static double SafeExp(double x, double exponent)
    Parameters
    Type Name Description
    Double x

    The value for which the exponential is to be calculated

    Double exponent

    The exponent value to use for calculating the exponential.

    Returns
    Type Description
    Double
    | Improve this Doc View Source

    SafeLog(Double)

    Calculate a base 10 logarithm in a safe manner to avoid math exceptions

    Declaration
    public static double SafeLog(double x)
    Parameters
    Type Name Description
    Double x

    The value for which the logarithm is to be calculated

    Returns
    Type Description
    Double

    The value of the logarithm, or 0 if the x argument was negative or zero

    | Improve this Doc View Source

    Scroll(Double, Double, Double)

    Scrolls the scale to the specified position.

    Declaration
    public void Scroll(double position, double scrollMin, double scrollMax)
    Parameters
    Type Name Description
    Double position

    The position to srcoll within the window. 0..1.

    Double scrollMin

    The minimum value of the scroll window.

    Double scrollMax

    The maximum value of the scroll window.

    | Improve this Doc View Source

    SetupScaleData(GraphPane, Axis)

    Setup some temporary transform values in preparation for rendering the Axis.

    Declaration
    public virtual void SetupScaleData(GraphPane pane, Axis axis)
    Parameters
    Type Name Description
    GraphPane pane

    A reference to the GraphPane object that is the parent or owner of this object.

    Axis axis

    The parent Axis for this Scale

    Remarks

    This method is typically called by the parent GraphPane object as part of the Draw(Graphics) method. It is also called by GeneralTransform(Double, Double, CoordType) and ReverseTransform(PointF, out Double, out Double) methods to setup for coordinate transformations.

    | Improve this Doc View Source

    Transform(Boolean, Int32, Double)

    Transform the coordinate value from user coordinates (scale value) to graphics device coordinates (pixels).

    Declaration
    public float Transform(bool isOverrideOrdinal, int i, double x)
    Parameters
    Type Name Description
    Boolean isOverrideOrdinal

    true to force the axis to honor the data value, rather than replacing it with the ordinal value

    Int32 i

    The ordinal value of this point, just in case this is an Ordinal axis

    Double x

    The coordinate value, in user scale units, to be transformed

    Returns
    Type Description
    Single

    the coordinate value transformed to screen coordinates for use in calling the Graphics draw routines

    Remarks

    This method takes into account the scale range (Min and Max), logarithmic state (IsLog), scale reverse state (IsReverse) and axis type (XAxis, YAxis, or Y2Axis). Note that the Rect must be valid, and SetupScaleData(GraphPane, Axis) must be called for the current configuration before using this method (this is called everytime the graph is drawn (i.e., Draw(Graphics) is called).

    | Improve this Doc View Source

    Transform(Double)

    Transform the coordinate value from user coordinates (scale value) to graphics device coordinates (pixels).

    Declaration
    public float Transform(double x)
    Parameters
    Type Name Description
    Double x

    The coordinate value, in user scale units, to be transformed

    Returns
    Type Description
    Single

    the coordinate value transformed to screen coordinates for use in calling the Graphics draw routines

    Remarks

    This method takes into account the scale range (Min and Max), logarithmic state (IsLog), scale reverse state (IsReverse) and axis type (XAxis, YAxis, or Y2Axis). Note that the Rect must be valid, and SetupScaleData(GraphPane, Axis) must be called for the current configuration before using this method (this is called everytime the graph is drawn (i.e., Draw(Graphics) is called).

    | Improve this Doc View Source

    Zoom(Double, Double, Boolean)

    Zoom the scale by the specified fraction, around the center value.

    Declaration
    public void Zoom(double zoomFraction, double centerVal, bool isZoomOnCenter)
    Parameters
    Type Name Description
    Double zoomFraction

    The amount to scale/zoom the scale.

    Double centerVal

    The value to center the zoom around.

    Boolean isZoomOnCenter

    if set to true the is used, otherwise the current center of the scale is used.

    Remarks

    When the fraction value is less than 0.0001 or greater than 1000.0 the scale will not be zoomed to avoid invalid scale values.

    Implements

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