SetCategories

Syntax graph.SetCategories(CategoryName [;CategoryName]*)

Description Sends the graph a set of category names separated by semi-colons (or the item delimiter, which is specified in the Main. ItemDelimiter method).

PopChart Server uses these category names to classify columns of data items. For example, the first data item in each Graph. SetSeries command is considered to be in the first column of data, and thus belongs to the first category name specified by the Graph.SetCategories command.

In most graphs, the category names become the values displayed along the x-axis (or category scale) of the graph. In some graphs, however, category names are used differently, or even ignored. Refer to Chapter 12, "Data Organization," for more information on how each graph type uses category names.

Note: You must send the graph a set of categories before you can send it any series data. This means the Graph.SetCategories command must occur before any Graph. SetSeries commands. X-Y and Time Plot graphs are exceptions to this, as they do not use categories.

This method can only be called once; if it is called again, it will erase all data in the graph and start anew.

The Graph.SetCategories also takes a special CLR_ macro, which overrides the color for all data items in that category. This macro should be followed by a six or eight (RGB plus Alpha) digit hexadecimal color code, indicating the value of the overriding color. It is placed in parenthesis in front of the name of the category it should override, as illustrated in Example 5.24.

Parameters Graph.SetCategories accepts the following parameters.

CategoryName

String

Specifies a category name. There can be any number of category names listed in a Graph.SetCategories method.

Example 5.23 Naming Your Categories

Graph.Categories(Fred; Barney; Gus; George)

Example 5.24 Changing Data Item Properties on the Fly

graph.SetSeries(Math; English; (CLR_00FF00)Science; History)