Class DataRange
Represents a data structure containing two System.
Inheritance
Namespace: Telerik.Windows.Controls.Charting
Assembly: Telerik.Windows.Controls.Charting.dll
Syntax
public sealed class DataRange : ValueType, IEquatable<DataRange>, IEqualityComparer<DataRange>
Constructors
DataRange(Double, Double)
Initializes a new instance of the Datafrom
and to
while
To is the maximal value of those two.
Declaration
public DataRange(double from, double to)
Parameters
System. The lower bound of the range. |
System. The upper bound of the range. |
Fields
Empty
Defines an empty range [0; 0].
Declaration
public static readonly DataRange Empty
Field Value
Invalid
Defines an invalid range [double.NaN; double.NaN].
Declaration
public static readonly DataRange Invalid
Field Value
Unit
Defines a unit range [0; 1].
Declaration
public static readonly DataRange Unit
Field Value
Properties
Center
Gets the center of the Data
Declaration
public double Center { get; }
Property Value
System.
|
From
Gets or sets the lower bound of the range. If it is greater than the value of To, they are swapped.
Declaration
public double From { get; set; }
Property Value
System.
|
See Also
IsValid
Gets a value indicating whether this instance is valid, i.e. both From and To
are not System.
Declaration
public bool IsValid { get; }
Property Value
System. Returns |
Length
Gets the length of the Data
Declaration
public double Length { get; }
Property Value
System. The actual length. |
See Also
To
Gets or sets the upper bound of the range. If it is less than the value of From, they are swapped.
Declaration
public double To { get; set; }
Property Value
System.
|
See Also
Methods
Create(Double, Double)
Creates a new instance of the Data
Declaration
public static DataRange Create(double from, double to)
Parameters
System. Lower bound of the range. |
System. Upper bound of the range. |
Returns
Data New instance of the DataRange structure. |
Equals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
System. Another object to compare to. |
Returns
System. Returns true if |
Equals(DataRange)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(DataRange other)
Parameters
Returns
System. Returns true if the current Data |
Equals(DataRange, DataRange)
Determines whether the specified Data
Declaration
public bool Equals(DataRange x, DataRange y)
Parameters
Data The first object of type |
Data The second object of type |
Returns
System. Returns true if the specified objects are equal; otherwise, false. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System. A 32-bit signed integer that is the hash code for this instance. |
GetHashCode(DataRange)
Returns a hash code for the specified Data
Declaration
public int GetHashCode(DataRange obj)
Parameters
Returns
System. A hash code for the specified object. |
Intersect(DataRange)
Calculates the intersection of two DataRanges.
Declaration
public DataRange Intersect(DataRange range)
Parameters
Data
|
Returns
Invalidate()
Declaration
public void Invalidate()
Invert(DataRange)
Inverts the specified range.
Declaration
public DataRange Invert(DataRange range)
Parameters
Data The range. |
Returns
Invert(DataRange, DataRange)
Inverts the specified target range.
Declaration
public static DataRange Invert(DataRange source, DataRange target)
Parameters
Returns
Log(Double, Double)
Calculates a DataRange with bounds, calculated as logarithm values of the current DataRange.
Declaration
public DataRange Log(double origin, double logarithmBase)
Parameters
System.
|
System.
|
Returns
Multiply(Double)
Scales the range by the specified scale factor.
Declaration
public DataRange Multiply(double scaleFactor)
Parameters
System. The scale factor. |
Returns
Normalize(Double)
Normalizes the specified value.
Declaration
public double Normalize(double value)
Parameters
System. The value that is to be normalized. |
Returns
System. Value in the range 0.0 to 1.0. |
Normalize(DataRange)
Normalizes the specified range.
Declaration
public DataRange Normalize(DataRange range)
Parameters
Data The range. |
Returns
Normalize(DataRange, Double)
Normalizes the value
to the specified range
.
Declaration
public static double Normalize(DataRange range, double value)
Parameters
Data The range. |
System. The value. |
Returns
System. Normalized value. |
Normalize(DataRange, DataRange)
Normalizes the specified range.
Declaration
public static DataRange Normalize(DataRange range, DataRange target)
Parameters
Returns
Restrict(Double)
Restricts the specified value
to be in the current range.
For values bellow the lower bound returns the lower bound,
and for values above the upper bound returns the upper bound.
Declaration
public double Restrict(double value)
Parameters
System. The value. |
Returns
Restrict(DataRange, Double)
Restricts the value
to fit the specified range
.
Declaration
public static double Restrict(DataRange range, double value)
Parameters
Data The range. |
System. The value. |
Returns
System. The restricted value. |
Round()
Rounds a double-precision floating point range value to the nearest integer value.
Declaration
public DataRange Round()
Returns
Scale(DataRange, Double)
Scales the specified range
by the provided scaleFactor
.
Declaration
public static DataRange Scale(DataRange range, double scaleFactor)
Parameters
Data The range. |
System. The scaleFactor. |
Returns
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
System. A System. |
Operators
Equality(DataRange, DataRange)
Implements the operator ==.
Declaration
public static bool operator ==(DataRange range1, DataRange range2)
Parameters
Returns
System. The result of the operator. |
Inequality(DataRange, DataRange)
Implements the operator !=.
Declaration
public static bool operator !=(DataRange range1, DataRange range2)
Parameters
Returns
System. The result of the operator. |
Multiply(Double, DataRange)
Implements the operator *.
Declaration
public static DataRange operator *(double scaleFactor, DataRange range)
Parameters
System. The scale factor. |
Data The range. |
Returns
Data The result of the operator. |
Multiply(DataRange, Double)
Implements the operator *.
Declaration
public static DataRange operator *(DataRange range, double scaleFactor)
Parameters
Data The range. |
System. The scale factor. |
Returns
Data The result of the operator. |