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


valueToFind

The value to find (e.g. 15.5).


Point value to find.
useValue

The point value to be examined (e.g. X, Y, Y2, etc.).


Which point value to use (X, Y1, Y2,...).

Returns the first data point in the collection with the specified X or Y-value.


Find first point with Max value from specified index.

Syntax

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

Parameters

valueToFind

The value to find (e.g. 15.5).


Point value to find.
useValue

The point value to be examined (e.g. X, Y, Y2, etc.).


Which point value to use (X, Y1, Y2,...).

Return Value

The first DataPoint object in the DataPointCollection that has the specified X or Y-value (e.g. X, Y, Y2, etc.). 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 second Y-value of 42 (e.g. "Y2" = 42). When the point is found, we set its color.

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

    'find data point value of 42
    Dim myPoint As DataPoint = Chart1.Series("Series1").Points.FindValue(42, "Y2")

    'set its color
    myPoint.Color = Color.BlueViolet

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

   
// Find data point value of 42.
   
DataPoint myPoint = Chart1.Series["Series1"].Points.FindValue(42, "Y2");
   
   
// Set its color.
   
myPoint.Color = Color.BlueViolet;

...

Remarks

Returns the first matching data point that has the specified point value (e.g. the first data point with an X-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.

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.