Dundas Chart for Windows Forms
FindValue(Double) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataPointCollection Class > FindValue Method : FindValue(Double) Method


valueToFind

The value to search for (e.g. 15.5).


Point value to find.

Returns the first data point in the collection that has a specified first Y-value. The search always starts at the beginning of the collection.


Find first point with Max value from specified index.

Syntax

Visual Basic (Declaration)  
Public Overloads Function FindValue( _
   ByVal valueToFind As Double _
) As DataPoint
Visual Basic (Usage) Copy Code
Dim instance As DataPointCollection
Dim valueToFind As Double
Dim value As DataPoint
 
value = instance.FindValue(valueToFind)
C#  
public DataPoint FindValue( 
   double valueToFind
)

Parameters

valueToFind

The value to search for (e.g. 15.5).


Point value to find.

Return Value

The first DataPoint object in the DataPointCollection that has the specified Y1 value. If no matching data point is found then null will be returned.


Found point or null.

Example

In the following sample we search the data points in the DataPointCollection for a point that has a first Y-value of 10. When the point is found we set its color.

Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

    ' Find the value of 10.
    Dim myPoint As DataPoint = Chart1.Series("Series1").Points.FindValue(10)

    ' Set its color.
    myPoint.Color = Color.BlueViolet

...
C# Copy Code
using Dundas.Charting.WinControl
...

   
// Find the value of 10.
   
DataPoint myPoint = Chart1.Series["Series1"].Points.FindValue(10);
   
   
// Set its color.
   
myPoint.Color = Color.BlueViolet;

...

Remarks

Returns the first data point with the specified Y1 value (e.g. a "Y" value of 15.5).

This function definition starts the search at the beginning of the collection, and can only be used to locate the first data point that has a specific value. To locate ALL data points in the collection that have a specific value use the definition that takes a startFromIndex parameter value.

To examine a value other than the first Y-value use a definition that has a useValue parameter.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.