Search
Chart.setDataSource Method
See Also
 






Sets the chart data source to the specified range of cells.

Namespace: com.mindfusion.spreadsheet.charts
Package: com.mindfusion.spreadsheet.charts

 Syntax

Java  Copy Code

public boolean setDataSource (
    String data,
    PlotBy plotBy,
    Boolean firstColumnAsLabel,
    Boolean firstRowAsLabel
)

 Parameters

data

A string specifying a range of cells or an expression which evaluates to a range of cells.

plotBy

A flag specifying whether the series are created from the columns or from the rows in the specified range.

firstColumnAsLabel

A flag specifying whether to use the values in the first column of the specified range as labels, or null, to attempt to automatically determine this based on the type of the data. This parameter is ignored by some charts that do not display labels.

firstRowAsLabel

A flag specifying whether to use the values in the first row of the specified range as labels, or null, to attempt to automatically determine this based on the type of the data. This parameter is ignored by some charts that do not display labels.

 Return Value

true if the data source was successfully set; false if the specified string does not identify a range of cells.

 Remarks

The changes caused by this method are automatically recorded for subsequent undo, therefore it is not necessary to call this method in the scope of a TrackChangesCommand.

 See Also