This documentation is archived and is not being maintained.

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

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
)

Parameters

dataSource
Type: System.Collections::IEnumerable
The data source.
seriesGroupByField
Type: System::String
The name of the field used to group data into the series.
xField
Type: System::String
Name of the field for X values.
yFields
Type: System::String
A comma-separated list of name(s) of the field(s) for Y value(s).
otherFields
Type: System::String
Other data point properties that can be bound.
sortingOrder
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: [P][:System.Web.UI.DataVisualization.Charting.DataPoint.AxisLabel], ToolTip(), Url(), Label(), LegendText(), LegendToolTip() and CustomProperties(), which are the names of the custom properties.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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