DataCount  FindSeries

Chapter 10: Methods for Graphs in the DataWindow Control

FindCategory

Description

Obtains the number of a category in a graph when you know the category’s label. The category values label the category axis.

Syntax

integer dwcontrol.FindCategory ( string graphcontrol, date categoryvalue )
integer dwcontrol.FindCategory ( string graphcontrol, datetime categoryvalue )
integer dwcontrol.FindCategory ( string graphcontrol, double categoryvalue )
integer dwcontrol.FindCategory ( string graphcontrol, string categoryvalue )
integer dwcontrol.FindCategory ( string graphcontrol, time categoryvalue )

Argument

Description

dwcontrol

A reference to the DataWindow control containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control.

categoryvalue

A value that is the category for which you want the number. The value you specify must be the same datatype as the datatype of the category axis.

Returns

Returns the number of the category named in categoryvalue in the graph. If an error occurs, FindCategory returns -1. If any argument’s value is NULL, FindCategory returns NULL.

Usage

Most of the category manipulation functions require a category number, rather than a name. However, when you delete and insert categories, existing categories are renumbered to keep the numbering consecutive. Use FindCategory when you know only a category’s label or when the numbering may have changed.

Examples

Example 1

These statements obtain the number of the category named Qty in the graph gr_computers in the DataWindow control dw_equipment:

integer CategoryNbr

CategoryNbr = &

		dw_equipment.FindCategory("gr_computers", "Qty")

See also





Copyright © 2004. Sybase Inc. All rights reserved. FindSeries

View this book as PDF