ModifyData

Changes the value of a data point in a series on a graph. There are two syntaxes depending on the type of graph.

To modify a data point in

Use

All graph types except scatter

Syntax 1

Scatter graphs

Syntax 2


Syntax 1: For all graph types except scatter

Description

Changes the value of a data point in a series on a graph. You can specify the data point to be modified by position or by category.

Applies to

Graph controls in windows and user objects. Does not apply to graphs within DataWindow objects (their data comes directly from the DataWindow).

Syntax

controlname.ModifyData (seriesnumber, datapoint, datavalue   {, categoryvalue } )

Argument

Description

controlname

The name of the graph in which you want to modify data.

seriesnumber

The number of the series in which you want to modify data.

datapoint

The number of the data point for which you want to modify the data.

datavalue

The new value of the data point. The datatype of datavalue is the same as the datatype of the values axis of the graph.

categoryvalue (optional)

The category for datavalue. The datatype of categoryvalue is the same as the datatype of the category axis of the graph.


Usage

When you specify categoryvalue, ModifyData changes the category value at the specified position, as well as the data value. If the name you specify already exists at another position, the data at that position is modified instead and the position in datapoint is ignored (the same behavior as InsertData).

When you specify a position of 0, ModifyData always behaves the same as InsertData. For a comparison of AddData, InsertData, and ModifyData, see the Usage section in InsertData.

Examples

These statements change the data for Apr in the series named Costs in the graph gr_product_data:

integer SeriesNbr, CategoryNbr
// Get the number of the series.
SeriesNbr = gr_product_data.FindSeries("Costs")
CategoryNbr = gr_product_data.FindCategory("Apr")
gr_product_data.ModifyData(SeriesNbr, &
    CategoryNbr, 1250)

See also

AddData

FindCategory

FindSeries

InsertCategory

InsertData

Syntax 2: For scatter graphs

Description

Changes the value of a data point in a series on a graph. You specify the data point by position and provide an x and y value.

Applies to

Graph controls in windows and user objects. Does not apply to graphs within DataWindow objects (their data comes directly from the DataWindow).

Syntax

controlname.ModifyData ( seriesnumber, datapoint, xvalue, yvalue )

Argument

Description

controlname

The name of the scatter graph in which you want to modify data in a series

seriesnumber

The number that identifies the series in which you want to modify data

datapoint

The number of the data point for which you want to modify data

xvalue

The new x value of the data you want to modify

yvalue

The new y value of the data you want to modify


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, ModifyData returns null.

Usage

For scatter graphs, there are no categories. You specify the position in the series whose data you want to modify and provide the x and y values for the data.

Examples

These statements modify the data point 9 in the series named Test One in the scatter graph gr_product_data:

integer SeriesNbr
SeriesNbr = gr_product.FindSeries("Test One")
gr_product_data.ModifyData(SeriesNbr, &
    9, 4.55, 86.38)

See also

AddData

FindSeries