Export (0) Print
Expand All

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

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

Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

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


Type: System.Collections.IEnumerable

The data source that is data bound by a chart.

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.

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.Windows.Forms.DataVisualization.Charting.DataPoint.AxisLabel], ToolTip, Url, Label, LegendText, LegendToolTip and CustomProperties, which are the names of the custom properties.

.NET Framework

Supported in: 4.5, 4

.NET Framework Client Profile

Supported in: 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.

© 2014 Microsoft