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


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 maximum specified 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 FindMaxValue( _
   ByVal useValue As String _
) As DataPoint
Visual Basic (Usage) Copy Code
Dim instance As DataPointCollection
Dim useValue As String
Dim value As DataPoint
 
value = instance.FindMaxValue(useValue)
C#  
public DataPoint FindMaxValue( 
   string useValue
)

Parameters

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 a maximum X or Y-value. If no data point is found (which will only occur if there are no points in the collection) then null will be returned.


Found point or null.

Example

The following sample returns the first data point that has a third Y-value (Y3) that is the series maximum, and we change the color of that point.

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

    ' Find max data point of Y3 values
    Dim maxPoint As DataPoint = Chart1.Series("Series1").Points.FindMaxValue("Y3")

    ' Set color of this point
    maxPoint.Color = Color.BlueViolet

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

   
// Find max data point of Y3 values
   
DataPoint maxPoint = Chart1.Series["Series1"].Points.FindMaxValue("Y3");
   
   
// Set color of this point
   
maxPoint.Color = Color.BlueViolet;

...

Remarks

Returns the first data point in the collection that has a maximum X or Y-value (there may be more than one point with the maximum value).

This function definition starts the search at the beginning of the collection, and can only be used to locate the first data point in the collection that has a maximum value. To locate ALL data points in the collection that have a maximum X or Y-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.