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


order
A PointsSortOrder enumeration value that determines if the sort is ascending or descending.
Sorting order.
seriesName
The name(s) of the series to sort. For multiple series use a comma-separated list.
Comma separated series names to sort.

Performs a sort on one or more series' data points using the specified order. The sort is based on the first Y-value of data points.


Sort series data points in specified order.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub Sort( _
   ByVal order As PointsSortOrder, _
   ByVal seriesName As String _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim order As PointsSortOrder
Dim seriesName As String
 
instance.Sort(order, seriesName)
C#  
public void Sort( 
   PointsSortOrder order,
   string seriesName
)

Parameters

order
A PointsSortOrder enumeration value that determines if the sort is ascending or descending.
Sorting order.
seriesName
The name(s) of the series to sort. For multiple series use a comma-separated list.
Comma separated series names to sort.

Example

Perform an ascending sort on two series named "Series1" and "Series2" before data is displayed by the chart.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Chart1.DataManipulator.Sort(PointsSortOrder.Ascending, "Series1,Series2")
End Sub

Remarks

This method performs an ascending or descending sort on all specified series' data points, and is based on the first Y-value of the data points.

Note that if multiple series are sorted then the series must be aligned, otherwise an exception will be thrown. Refer to the Aligning Series topic for information on aligned series.

IMPORTANT: ALL series will be sorted using the Y-value from the FIRST listed series (i.e. all data points, regardless of the series they belong to, are sorted based on the first series).

Use another definition of this overloaded method to:sort points based on their X-values (or other Y-values);or to use a custom sort routine.

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.