Version

SetComboChartSourceData Method

Sets the source data range for a combo chart.
Syntax
'Declaration
 
Public Sub SetComboChartSourceData( _
   ByVal dataRange As String, _
   ByVal seriesChartTypes() As ChartType, _
   Optional ByVal plotByRows As Boolean, _
   Optional ByVal cellReferenceMode As Nullable(Of CellReferenceMode) _
) 
public void SetComboChartSourceData( 
   string dataRange,
   ChartType[] seriesChartTypes,
   bool plotByRows,
   Nullable<CellReferenceMode> cellReferenceMode
)

Parameters

dataRange
The data range for the combo chart
seriesChartTypes
An array of ChartType constants which specify the chart type for each series yielded from the specified dataRange.
plotByRows
Optional. True to plot by rows where each row is a separate series or false to plot by columns where each column is a separate series. The default is false.
cellReferenceMode
Optional. Determines how to parse the dataRange.
Exceptions
ExceptionDescription
System.ExceptionThe current value of the ChartType property is not Combo.
System.NotSupportedExceptionThe specified seriesChartTypes array contains one or more values which are not supported within a combo chart.
System.NotSupportedExceptionThe specified seriesChartTypes array contains a combination of values which would require more than the maximum allowable number of axes (two).
Remarks

Combo charts support multiple chart types within the main chart, with each different chart type being associated with one or more Infragistics.Documents.Excel.Charts.Series.

Use this method to populate the SeriesCollection for a combo chart.

For example, given a dataRange which yields three series, the caller can specify an array with three elements as the value of the seriesChartTypes parameter. Each array element is then applied to the corresponding series, in the same order in which they appear in the array.

Duplicate ChartType values can appear in the seriesChartTypes array, in which case the corresponding series appear within the same chart. For example, specifying an array with ClusteredColumn, Line, and Line results in a combo chart with the first series appearing in a clustered column chart, and the remaining series appearing in a line chart.

Specifying null for the value of the seriesChartTypes parameter is treated the same as a two-element array containing 'ColumnClustered' and 'Line', resulting in a clustered column chart for the first series, and a line chart for the remaining series.

If fewer values are present in the seriesChartTypes array than the number of series yielded from the specified dataRange, the remaining series acquire the same ChartType and AxisGroup as the last element in the seriesChartTypes array. If more values are present in the array than the number of series yielded, these values are ignored.

Certain chart type values are invalid for a combo chart; if any of these chart types are present in the array, an exception is thrown, listing the invalid chart types.

The following table lists the ChartType values which are supported in combo charts, grouped by series type:

SeriesType ChartType (supported in combo charts)
Area Area, AreaStacked, AreaStacked100
Bar ColumnClustered, ColumnStacked, ColumnStacked100, BarClustered, BarStacked, BarStacked100, BarOfPie
Line Line, LineStacked, LineStacked100, LineMarkers, LineMarkersStacked, LineMarkersStacked100
Pie Pie, PieExploded, PieOfPie, Doughnut, DoughnutExploded
Radar Radar, RadarFilled, RadarMarkers
Scatter XYScatter, XYScatterLines, XYScatterLinesNoMarkers, XYScatterSmooth, XYScatterSmoothNoMarkers
Bubble Not Supported
Surface Not Supported

Combo charts support a maximum of two axis groups. If the combination of values in the seriesChartTypes array necessitates more than two axis groups, an exception is thrown.

Combo charts require a minimum of two Infragistics.Documents.Excel.Charts.Series. If the specified dataRange yields less that two series, an exception is thrown.

If the combination of series used in a combo chart is indistinguishable from a non-combo chart, the chart may not be recognized by Excel as a combo chart. For example, adding two series, one of type Radar and one of type RadarMarkers, is a valid combination. When opened in Excel, however, such a chart will not be recognized as a combo chart, since the combination of series does not necessitate multiple chart elements. All relevant property values are persisted, however, and there is no distinguishable difference between the original chart and the serialized one.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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

See Also