SetData Method

         Example         Applies To

Sets data for the specified chart object.

Syntax

expression.SetData(Dimension, DataSourceIndex, DataReference)

expression   An expression that returns a WCChart, WCErrorBars, or WCSeries object.

Dimension   Required ChartDimensionsEnum or ChartErrorBarCustomValuesEnum object. Specifies the data dimension to be set.

DataSourceIndex   Required Long. Specifies the data source as the index to the WCDataSources collection, or specifies chDataLiteral to set data from a literal source. For the WCChart object, you can use chDataLiteral only to set series names and categories.

DataReference   Optional Variant. For WCChart and WCSeries objects, this argument specifies the data reference as an Excel-style range reference ("A1:D4" , for example), or a row-set column name. When the DataSourceIndex argument is set to chDataLiteral, you can set DataReference to a one-dimensional array or a tab-delimited string. For WCErrorBars objects, this argument specifies an array of Double or String values you can use for error-bar values. Note that you can use this argument only with custom error bars (the error-bar Type property must be set to chErrorBarTypeCustom).