Label

Applies to

grAxis objects in Graph controls, ListViewItem objects, TreeViewItem objects

Description

Within graphs

The Label property specifies the label of an axis of the graph.

Within ListView and TreeView controls

The Label property specifies the label associated with a ListViewItem or TreeViewItem object.You cannot manipulate items in TreeView controls in a painter. You must write scripts to add items to a TreeView.

Usage

In a painter

To specify an Axis label in a graph control:

  1. Display the Axis tab page of the graph control's Properties view.

  2. Select the desired axis from the Axis drop-down list.

  3. Enter the label text in the Label text field.

To specify labels for items in a ListView control:

  1. Display the Items tab page of the ListView control's Properties view.

  2. For each item, enter label text in the appropriate Text field.

In scripts

The Label property takes a string value. The following example sets text for the label on the Values axis of graph gr_1.

gr_1.Values.Label = 'Lawsuits per 1000'

To add or insert an item with a label into a ListView control, use the AddItem or InsertItem functions. For example, this line adds an item to ListView control lv_1, specifying the label and picture index for the item:

lv_1.AddItem ( "Oranges", 1)

To change the label, get the item from the ListView and set the item's Label property:

ListViewItem lvi
lv_1.GetItem(4, lvi)
lvi.Label = "Apples" 
lv_1.SetItem(4, lvi)

To add or insert items in a TreeView control, use the InsertItem, InsertItemFirst, InsertItemLast, or InsertItemSort functions.

For more information, see Using TreeView Controls in Application Techniques and the section called “Using ListView controls” in Application Techniques.