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.
Assembly: System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)
public: void DataBindCrossTable( IEnumerable^ dataSource, String^ seriesGroupByField, String^ xField, String^ yFields, String^ otherFields )
Parameters
- dataSource
-
Type:
System.Collections::IEnumerable^
The data source that is data bound by a chart.
- seriesGroupByField
-
Type:
System::String^
The name of the field used to group data into the series.
- xField
-
Type:
System::String^
The 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^
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: AxisLabel, ToolTip, P:System.Windows.Forms.DataVisualization.Charting.DataPointCustomProperties.Url, Label, LegendText, LegendToolTip and CustomProperties, which are the names of the custom properties.
Available since 4.0