Chart.DataBindCrossTable Method (IEnumerable, String, String, String, String, PointSortOrder)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Data binds a chart to the table, with one series created per unique value in a given column.

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

public void DataBindCrossTable(
	IEnumerable dataSource,
	string seriesGroupByField,
	string xField,
	string yFields,
	string otherFields,
	PointSortOrder sortingOrder


Type: System.Collections.IEnumerable

The data source from which the chart is bound.

Type: System.String

The name of the field used to group data into the series.

Type: System.String

The name of the field for X values.

Type: System.String

A comma-separated list of name(s) of the field(s) for Y value(s).

Type: System.String

The other data point properties that can be bound.

Type: System.Web.UI.DataVisualization.Charting.PointSortOrder

Series will be sorted by group field values in the specified order.

Series will be automatically added to the chart, depending on the number of unique values in the given seriesGroupByField column of the data source; in other words, the creation of series depends upon grouping of a column.

The data source can be a OleDbDataReader, SqlDataReader or a DataView object.

Note that all collections that implement the IEnumerable interface can be used.

Other data point properties besides X and Y-values can be bound. The format is: PointProperty=Field[{Format}] [,PointProperty= Field[{Format}]]. For example:"Tooltip=Price{C1},Href=WebSiteName".

A list of these data point properties is as follows: AxisLabel, ToolTip, Url, Label, LegendText, LegendToolTip and CustomProperties, which are the names of the custom properties.

.NET Framework
Available since 4.0
Return to top