Redigera

Dela via


Chart.AlignDataPointsByAxisLabel Method

Definition

Aligns data points using their axis labels.

Overloads

AlignDataPointsByAxisLabel()

Aligns data points along the X axis using their axis labels. Applicable when multiple series are indexed and their X-values are strings.

AlignDataPointsByAxisLabel(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.

AlignDataPointsByAxisLabel(PointSortOrder)

Aligns data points using their axis labels. All series in the chart are aligned, using the specified sort order.

AlignDataPointsByAxisLabel(String, PointSortOrder)

Aligns data points using their axis labels.

AlignDataPointsByAxisLabel()

Aligns data points along the X axis using their axis labels. Applicable when multiple series are indexed and their X-values are strings.

public:
 void AlignDataPointsByAxisLabel();
public void AlignDataPointsByAxisLabel ();
member this.AlignDataPointsByAxisLabel : unit -> unit
Public Sub AlignDataPointsByAxisLabel ()

Applies to

AlignDataPointsByAxisLabel(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.

public:
 void AlignDataPointsByAxisLabel(System::String ^ series);
public void AlignDataPointsByAxisLabel (string series);
member this.AlignDataPointsByAxisLabel : string -> unit
Public Sub AlignDataPointsByAxisLabel (series As String)

Parameters

series
String

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

Remarks

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.

Applies to

AlignDataPointsByAxisLabel(PointSortOrder)

Aligns data points using their axis labels. All series in the chart are aligned, using the specified sort order.

public:
 void AlignDataPointsByAxisLabel(System::Windows::Forms::DataVisualization::Charting::PointSortOrder sortingOrder);
public void AlignDataPointsByAxisLabel (System.Windows.Forms.DataVisualization.Charting.PointSortOrder sortingOrder);
member this.AlignDataPointsByAxisLabel : System.Windows.Forms.DataVisualization.Charting.PointSortOrder -> unit
Public Sub AlignDataPointsByAxisLabel (sortingOrder As PointSortOrder)

Parameters

sortingOrder
PointSortOrder

A PointSortOrder object that indicates if ascending or descending sort order is used on axis labels, which in turn determines the order by which points that previously occupied the same axis space are displayed.

Applies to

AlignDataPointsByAxisLabel(String, PointSortOrder)

Aligns data points using their axis labels.

public:
 void AlignDataPointsByAxisLabel(System::String ^ series, System::Windows::Forms::DataVisualization::Charting::PointSortOrder sortingOrder);
public void AlignDataPointsByAxisLabel (string series, System.Windows.Forms.DataVisualization.Charting.PointSortOrder sortingOrder);
member this.AlignDataPointsByAxisLabel : string * System.Windows.Forms.DataVisualization.Charting.PointSortOrder -> unit
Public Sub AlignDataPointsByAxisLabel (series As String, sortingOrder As PointSortOrder)

Parameters

series
String

A comma-separated list of series that should be aligned by axis label.

sortingOrder
PointSortOrder

A PointSortOrder enumeration value that determines if ascending or descending sort order is used on axis labels, which in turn determines the order by which points that previously occupied the same axis space are displayed.

Remarks

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.

Applies to