Class NoDupePointList
A collection class to maintain a set of samples.
Implements
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class NoDupePointList : List<DataPoint>, IList<DataPoint>, ICollection<DataPoint>, IEnumerable<DataPoint>, IList, ICollection, IEnumerable, IPointListEdit, IPointList, ICloneable
Remarks
This type, intended for very large datasets, will reduce the number of points displayed by eliminating individual points that overlay (at the same pixel location) on the graph. Note that this type probably does not make sense for line plots, but is intended primarily for scatter plots.
Constructors
| Improve this Doc View SourceNoDupePointList()
default constructor
Declaration
public NoDupePointList()
NoDupePointList(NoDupePointList)
copy constructor -- this returns a copy of the structure, but it does not duplicate the data (it just keeps a reference to the original)
Declaration
public NoDupePointList(NoDupePointList rhs)
Parameters
Type | Name | Description |
---|---|---|
NoDupePointList | rhs | The NoDupePointList to be copied |
Fields
| Improve this Doc View Source_filteredCount
Protected field that stores the number of data points after filtering (e.g., FilterData(GraphPane, Axis, Axis) has been called). The Count property returns the total count for an unfiltered dataset, or _filteredCount for a dataset that has been filtered.
Declaration
[CLSCompliant(false)]
protected int _filteredCount
Field Value
Type | Description |
---|---|
Int32 |
_filterMode
Protected field that stores a value that determines how close a point must be to a prior neighbor in order to be filtered out. Use the public property FilterMode to access this value.
Declaration
[CLSCompliant(false)]
protected int _filterMode
Field Value
Type | Description |
---|---|
Int32 |
_isFiltered
Protected field that stores a value indicating whether or not the data have been filtered. If the data have not been filtered, then Count will be equal to TotalCount. Use the public property IsFiltered to access this value.
Declaration
[CLSCompliant(false)]
protected bool _isFiltered
Field Value
Type | Description |
---|---|
Boolean |
_visibleIndicies
Protected array of indices for all the points that are currently visible. This only applies if IsFiltered is true.
Declaration
[CLSCompliant(false)]
protected int[] _visibleIndicies
Field Value
Type | Description |
---|---|
Int32[] |
Properties
| Improve this Doc View SourceCount
Gets the number of active samples in the collection. This is the number of samples that are non-duplicates. See the TotalCount property to get the total number of samples in the list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
FilterMode
Gets or sets a value that determines how close a point must be to a prior neighbor in order to be filtered out.
Declaration
public int FilterMode { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
A value of 0 indicates that subsequent points must coincide exactly at the same pixel location. A value of 1 or more indicates that number of pixels distance from a prior point that will cause a new point to be filtered out. For example, a value of 2 means that, once a particular pixel location is taken, any subsequent point that lies within 2 pixels of that location will be filtered out.
IsFiltered
Gets a value indicating whether or not the data have been filtered. If the data have not been filtered, then Count will be equal to TotalCount.
Declaration
public bool IsFiltered { get; }
Property Value
Type | Description |
---|---|
Boolean |
Item[Int32]
Indexer: get the DataPoint instance at the specified ordinal position in the list
Declaration
public PointPair this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal position in the list of points |
Property Value
Type | Description |
---|---|
PointPair | Returns a PointPair instance. The Z and Tag properties will be defaulted to Missing and null, respectively. |
Remarks
This method will throw an exception if the index is out of range. This can happen if the index is less than the number of filtered values, or if data points are removed from a filtered dataset with updating the filter (by calling FilterData(GraphPane, Axis, Axis)).
TotalCount
Gets the total number of samples in the collection. See the Count property to get the number of active (non-duplicate) samples in the list.
Declaration
public int TotalCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceAdd(Double, Double)
Append a point to the collection
Declaration
public void Add(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The x value of the point to append |
Double | y | The y value of the point to append |
Add(PointPair)
Append a data point to the collection
Declaration
public void Add(PointPair pt)
Parameters
Type | Name | Description |
---|---|---|
PointPair | pt | The PointPair value to append |
ClearFilter()
Clears any filtering previously done by a call to FilterData(GraphPane, Axis, Axis). After calling this method, all data points will be visible, and Count will be equal to TotalCount.
Declaration
public void ClearFilter()
Clone()
typesafe clone method
Declaration
public NoDupePointList Clone()
Returns
Type | Description |
---|---|
NoDupePointList | A new cloned NoDupePointList. This returns a copy of the structure, but it does not duplicate the data (it just keeps a reference to the original) |
FilterData(GraphPane, Axis, Axis)
Go through the collection, and hide (filter out) any points that fall on the same pixel location as a previously included point.
Declaration
public void FilterData(GraphPane pane, Axis xAxis, Axis yAxis)
Parameters
Type | Name | Description |
---|---|---|
GraphPane | pane | The GraphPane into which the data will be plotted. |
Axis | xAxis | The Axis class to be used in the X direction for plotting these data. This can be an XAxis or a X2Axis. |
Axis | yAxis | The Axis class to be used in the Y direction for plotting these data. This can be a YAxis or a Y2Axis, and can be a primary or secondary axis (if multiple Y or Y2 axes are being used). |
Remarks
This method does not delete any points, it just temporarily hides them until the next call to FilterData(GraphPane, Axis, Axis) or ClearFilter(). You should call FilterData(GraphPane, Axis, Axis) once your collection of points has been constructed. You may need to call FilterData(GraphPane, Axis, Axis) again if you add points, or if the chart rect changes size (by resizing, printing, image save, etc.), or if the scale range changes. You must call AxisChange() before calling this method so that the Rect and the scale ranges are valid. This method is not valid for ordinal axes (but ordinal axes don't make sense for very large datasets anyway).
GetDataPointAt(Int32)
Protected method to access the internal DataPoint collection, without any translation to a PointPair.
Declaration
protected DataPoint GetDataPointAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal position of the DataPoint of interest |
Returns
Type | Description |
---|---|
DataPoint |
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object |