Export (0) Print
Expand All

Chart.AlignDataPointsByAxisLabel Method (String)

Aligns data points from different series along the X axis using their axis labels. The specified series in the chart are aligned using an ascending sort order.

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public void AlignDataPointsByAxisLabel(
	string series
)

Parameters

series
Type: System.String

A comma-separated list of series that will have their data points aligned to the X axis using the data point axis labels.

This method is used to align data points from different series along the X axis using their axis labels, and is applicable when:

  • Multiple series are displayed and are indexed; that is, all data points have an XValue of 0, or the IsXValueIndexed property is true.

  • All data points have non-empty axis labels, which are unique to their Series. If they are not unique, an exception will be thrown.

This situation is very common when data-binding results in the creation of multiple series, and string values are used for X-axis values.

Two issues arise when multiple, indexed series are plotted, and the X-values are set using string values:

  • It cannot be guaranteed that data points from different series with the same string X-values will be plotted at the same index along the X axis.

  • Only the axis label for the data points in the first series will be displayed, even though data points from other series with the same index have axis labels too.

By default, points are plotted in the order in which they are stored in their series. To specify a sort order, use an AlignDataPointsByAxisLabel method overload that has a sortingOrder parameter.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft