Class Scale
The Scale class is an abstract base class that encompasses the properties and methods associated with a scale of data.
Implements
Inherited Members
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 SourceScale(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 |
Scale(Axis)
Declaration
public Scale(Axis ownerAxis)
Parameters
Type | Name | Description |
---|---|---|
Axis | ownerAxis |
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 |
Fields
| Improve this Doc View Sourceschema
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 SourceAlign
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.
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.
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
| Improve this Doc View SourceExponent
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
| Improve this Doc View SourceFontSpec
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
| Improve this Doc View SourceFormat
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
| Improve this Doc View SourceFormatAuto
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
| Improve this Doc View SourceIsAnyOrdinal
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
| Improve this Doc View SourceIsDate
True if this scale is Date, false otherwise.
Declaration
public bool IsDate { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsExponent
True if this scale is Exponent, false otherwise.
Declaration
public bool IsExponent { get; }
Property Value
Type | Description |
---|---|
Boolean |
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
| Improve this Doc View SourceIsLog
True if this scale is Log, false otherwise.
Declaration
public bool IsLog { get; }
Property Value
Type | Description |
---|---|
Boolean |
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.
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).
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
| Improve this Doc View SourceIsSkipCrossLabel
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.
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.
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.
IsText
True if this scale is Text, false otherwise.
Declaration
public bool IsText { get; }
Property Value
Type | Description |
---|---|
Boolean |
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).
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
| Improve this Doc View SourceLabelGap
The gap between the scale labels and the tics.
Declaration
public float LabelGap { get; set; }
Property Value
Type | Description |
---|---|
Single |
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
| Improve this Doc View SourceMagAuto
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
| Improve this Doc View SourceMajorStep
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
| Improve this Doc View SourceMajorStepAuto
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
| Improve this Doc View SourceMajorUnit
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
| Improve this Doc View SourceMax
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
| Improve this Doc View SourceMaxAuto
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
| Improve this Doc View SourceMaxGrace
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
| Improve this Doc View SourceMin
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
| Improve this Doc View SourceMinAuto
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
| Improve this Doc View SourceMinGrace
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
| Improve this Doc View SourceMinorStep
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
| Improve this Doc View SourceMinorStepAuto
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
| Improve this Doc View SourceMinorUnit
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
| Improve this Doc View SourceTextLabels
The text labels for this Axis.
Declaration
public string[] TextLabels { get; set; }
Property Value
Type | Description |
---|---|
String[] |
Remarks
| Improve this Doc View SourceType
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 SourceCalcBoundedStepSize(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).
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.
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).
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. |
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. |
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.
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 |
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.
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.
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.
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.
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.
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 |
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. |
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.)
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).
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 |
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 |
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. |
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 |
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.
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).
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).
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 |
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.