Class PointPairList
A collection class containing a list of PointPair objects that define the set of points to be displayed on the curve.
Implements
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class PointPairList : List<PointPair>, IList<PointPair>, ICollection<PointPair>, IEnumerable<PointPair>, IList, ICollection, IEnumerable, IPointListEdit, IPointList, ICloneable
Constructors
| Improve this Doc View SourcePointPairList()
Default constructor for the collection class
Declaration
public PointPairList()
PointPairList(Double[], Double[])
Constructor to initialize the PointPairList from two arrays of type double.
Declaration
public PointPairList(double[] x, double[] y)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | x | |
| Double[] | y |
PointPairList(Double[], Double[], Double[])
Constructor to initialize the PointPairList from three arrays of type double.
Declaration
public PointPairList(double[] x, double[] y, double[] baseVal)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | x | |
| Double[] | y | |
| Double[] | baseVal |
PointPairList(IPointList)
Constructor to initialize the PointPairList from an IPointList
Declaration
public PointPairList(IPointList list)
Parameters
| Type | Name | Description |
|---|---|---|
| IPointList | list |
PointPairList(PointPairList)
The Copy Constructor
Declaration
public PointPairList(PointPairList rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| PointPairList | rhs | The PointPairList from which to copy |
Fields
| Improve this Doc View Source_sorted
Private field to maintain the sort status of this PointPairList. Use the public property Sorted to access this value.
Declaration
[CLSCompliant(false)]
protected bool _sorted
Field Value
| Type | Description |
|---|---|
| Boolean |
Properties
| Improve this Doc View SourceSorted
true if the list is currently sorted.
Declaration
public bool Sorted { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
See Also
Methods
| Improve this Doc View SourceAdd(Double, Double)
Add a single point to the PointPairList from values of type double.
Declaration
public void Add(double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | x | The X value |
| Double | y | The Y value |
Add(Double, Double, Double)
Add a single point to the PointPairList from values of type double.
Declaration
public void Add(double x, double y, double z)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | x | The X value |
| Double | y | The Y value |
| Double | z | The Z or lower dependent axis value |
Add(Double, Double, Double, String)
Add a single point to the PointPairList from values of type double.
Declaration
public void Add(double x, double y, double z, string tag)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | x | The X value |
| Double | y | The Y value |
| Double | z | The Z or lower dependent axis value |
| String | tag | The Tag value for the PointPair |
Add(Double, Double, String)
Add a single point to the PointPairList from values of type double.
Declaration
public void Add(double x, double y, string tag)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | x | The X value |
| Double | y | The Y value |
| String | tag | The Tag value for the PointPair |
Add(Double[], Double[])
Add a set of points to the PointPairList from two arrays of type double. If either array is null, then a set of ordinal values is automatically generated in its place (see Ordinal. If the arrays are of different size, then the larger array prevails and the smaller array is padded with Missing values.
Declaration
public void Add(double[] x, double[] y)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | x | A double[] array of X values |
| Double[] | y | A double[] array of Y values |
Add(Double[], Double[], Double[])
Add a set of points to the PointPairList from three arrays of type double.
If the X or Y array is null, then a set of ordinal values is automatically
generated in its place (see Ordinal. If the
Declaration
public void Add(double[] x, double[] y, double[] z)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | x | A double[] array of X values |
| Double[] | y | A double[] array of Y values |
| Double[] | z | A double[] array of Z or lower-dependent axis values |
Add(PointPair)
Add a PointPair object to the collection at the end of the list.
Declaration
public void Add(PointPair point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointPair | point | The PointPair object to be added |
Add(PointPairList)
Add a PointPairList object to the collection at the end of the list.
Declaration
public void Add(PointPairList pointList)
Parameters
| Type | Name | Description |
|---|---|---|
| PointPairList | pointList | A reference to the PointPairList object to be added |
Clone()
Typesafe, deep-copy clone method.
Declaration
public PointPairList Clone()
Returns
| Type | Description |
|---|---|
| PointPairList | A new, independent copy of this class |
Equals(Object)
Compare two PointPairList objects to see if they are equal.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The PointPairList to be compared with for equality. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the PointPairList objects are equal, false otherwise. |
Overrides
Remarks
Equality is based on equal count of PointPair items, and each individual PointPair must be equal (as per the Equals(Object) method.
GetHashCode()
Return the HashCode from the base class.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 |
Overrides
| Improve this Doc View SourceIndexOfTag(String)
Declaration
public int IndexOfTag(string label)
Parameters
| Type | Name | Description |
|---|---|---|
| String | label | The String label that is in the Tag attribute of the item to be found. |
Returns
| Type | Description |
|---|---|
| Int32 | The zero-based index of the specified PointPair, or -1 if the PointPair is not in the list |
Remarks
| Improve this Doc View SourceInsert(Int32, Double, Double)
Add a single point (from values of type double ) to the PointPairList at the specified, zero-based, index location.
Declaration
public void Insert(int index, double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The zero-based ordinal index where the point is to be added in the list. |
| Double | x | The X value |
| Double | y | The Y value |
Insert(Int32, Double, Double, Double)
Add a single point (from values of type double ) to the PointPairList at the specified, zero-based, index location.
Declaration
public void Insert(int index, double x, double y, double z)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The zero-based ordinal index where the point is to be added in the list. |
| Double | x | The X value |
| Double | y | The Y value |
| Double | z | The Z or lower dependent axis value |
Insert(Int32, PointPair)
Add a PointPair object to the collection at the specified, zero-based, index location.
Declaration
public void Insert(int index, PointPair point)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The zero-based ordinal index where the point is to be added in the list. |
| PointPair | point | The PointPair object to be added. |
InterpolateX(Double)
Linearly interpolate the data to find an arbitraty Y value that corresponds to the specified X value.
Declaration
public double InterpolateX(double xTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | xTarget | The target X value on which to interpolate |
Returns
| Type | Description |
|---|---|
| Double | The Y value that corresponds to the |
Remarks
This method uses linear interpolation with a binary search algorithm. It therefore requires that the x data be monotonically increasing. Missing values are not allowed. This method will extrapolate outside the range of the PointPairList if necessary.
InterpolateY(Double)
Linearly interpolate the data to find an arbitraty X value that corresponds to the specified Y value.
Declaration
public double InterpolateY(double yTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | yTarget | The target Y value on which to interpolate |
Returns
| Type | Description |
|---|---|
| Double | The X value that corresponds to the |
Remarks
This method uses linear interpolation with a binary search algorithm. It therefore requires that the Y data be monotonically increasing. Missing values are not allowed. This method will extrapolate outside the range of the PointPairList if necessary.
LinearRegression(IPointList, Int32)
Use linear regression to form a least squares fit of an existing IPointList instance.
Declaration
public PointPairList LinearRegression(IPointList points, int pointCount)
Parameters
| Type | Name | Description |
|---|---|---|
| IPointList | points | An IPointList instance containing the data to be regressed. |
| Int32 | pointCount | The number of desired points to be included in the resultant PointPairList. |
Returns
| Type | Description |
|---|---|
| PointPairList | A new PointPairList containing the resultant data fit. |
Remarks
The output PointPairList will cover the same X range of data as the original dataset.
LinearRegression(IPointList, Int32, Double, Double)
Use linear regression to form a least squares fit of an existing IPointList instance.
Declaration
public PointPairList LinearRegression(IPointList points, int pointCount, double minX, double maxX)
Parameters
| Type | Name | Description |
|---|---|---|
| IPointList | points | An IPointList instance containing the data to be regressed. |
| Int32 | pointCount | The number of desired points to be included in the resultant PointPairList. |
| Double | minX | The minimum X value of the resultant PointPairList. |
| Double | maxX | The maximum X value of the resultant PointPairList. |
Returns
| Type | Description |
|---|---|
| PointPairList | A new PointPairList containing the resultant data fit. |
SetX(Double[])
Set the X values for this PointPairList from the specified array of double values.
Declaration
public void SetX(double[] x)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | x | An array of double values that will replace the existing X values in the PointPairList. |
Remarks
If
SetY(Double[])
Set the Y values for this PointPairList from the specified array of double values.
Declaration
public void SetY(double[] y)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | y | An array of double values that will replace the existing Y values in the PointPairList. |
Remarks
If
SetZ(Double[])
Set the Z values for this PointPairList from the specified array of double values.
Declaration
public void SetZ(double[] z)
Parameters
| Type | Name | Description |
|---|---|---|
| Double[] | z | An array of double values that will replace the existing Z values in the PointPairList. |
Remarks
If
Sort()
Sorts the list according to the point x values. Will not sort the list if the list is already sorted.
Declaration
public bool Sort()
Returns
| Type | Description |
|---|---|
| Boolean | If the list was sorted before sort was called |
Sort(SortType)
Sorts the list according to the point values . Will not sort the list if the list is already sorted.
Declaration
public bool Sort(SortType type)
Parameters
| Type | Name | Description |
|---|---|---|
| SortType | type |
Returns
| Type | Description |
|---|---|
| Boolean | If the list was sorted before sort was called |
SplineInterpolateX(Double, Double)
Use Cardinal Splines to Interpolate the data to find an arbitraty Y value that corresponds to the specified X value.
Declaration
public double SplineInterpolateX(double xTarget, double tension)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | xTarget | The target X value on which to interpolate |
| Double | tension | The tension setting that controls the curvature of the spline fit. Typical values are between 0 and 1, where 0 is a linear fit, and 1 is lots of "roundness". Values greater than 1 may give odd results. |
Returns
| Type | Description |
|---|---|
| Double | The Y value that corresponds to the |
Remarks
This method uses cardinal spline interpolation with a binary search algorithm. It therefore requires that the x data be monotonically increasing. Missing values are not allowed. This method will not extrapolate outside the range of the PointPairList (it returns Missing if extrapolation would be required). WARNING: Cardinal spline interpolation can generate curves with non-unique X values for higher tension settings. That is, there may be multiple X values for the same Y value. This routine follows the path of the spline curve until it reaches the FIRST OCCURRENCE of the target X value. It does not check to see if other solutions are possible.
SumX(PointPairList)
Add the X values from the specified PointPairList object to this
PointPairList. If
Declaration
public void SumX(PointPairList sumList)
Parameters
| Type | Name | Description |
|---|---|---|
| PointPairList | sumList | A reference to the PointPairList object to be summed into the this PointPairList. |
SumY(PointPairList)
Add the Y values from the specified PointPairList object to this
PointPairList. If
Declaration
public void SumY(PointPairList sumList)
Parameters
| Type | Name | Description |
|---|---|---|
| PointPairList | sumList | A reference to the PointPairList object to be summed into the this PointPairList. |
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone()
Declaration
object ICloneable.Clone()
Returns
| Type | Description |
|---|---|
| Object | A deep copy of this object |