Dundas Chart for ASP.NET
FindMaxValue() Method
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > DataPointCollection Class > FindMaxValue Method : FindMaxValue() Method


Returns the first data point in the collection with a maximum 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 FindMaxValue() As DataPoint
Visual Basic (Usage) Copy Code
Dim instance As DataPointCollection
Dim value As DataPoint
 
value = instance.FindMaxValue()
C#  
public DataPoint FindMaxValue()

Return Value

The first DataPoint object in the DataPointCollection that has a maximum first 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 in the collection that has a first Y-value that is equal to the series' maximum Y1 value. We then change the color of that point.

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

    ' Find point with maximum Y value and change color
    Dim maxValuePoint As DataPoint = Chart1.Series("Series1").Points.FindMaxValue()
    maxValuePoint.Color = Color.FromArgb(255, 128, 128)

...
C# Copy Code
using Dundas.Charting.WebControl;
...

   
// Find point with maximum Y value and change color
   
DataPoint maxValuePoint = chart1.Series["Series1"].Points.FindMaxValue();
   maxValuePoint.Color = Color.FromArgb(255, 128, 128);

...

Remarks

Returns the first data point that has the largest first Y-value (there may be multiple points that have the same 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 with the maximum Y1 value. To locate ALL data points in the collection with the maximum Y1 value use the definition that takes a startFromIndex parameter value.

To examine a value other than the first Y-value (e.g. Y3, or third Y value) use a definition that takes has 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

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.