DataLabel objects are created automatically when the user performs a drag-and-drop. If the drag-and-drop begins inside an EditTable object, the column heading becomes the name of the data object, and the row annotation becomes a label array. For instance, if the user selects three columns for drag-and-drop, this will automatically create three DataSampled objects (one for each column), with a DataLabel object containing the annotation for each row.
For a Chart, DataLabel objects are used to annotate the axes. For a Table, DataLabel objects provide row or column annotation. The data label has an orientation which specifies which axis (when attached to a chart) it corresponds to. If you specify more than one DataLabel for a specific orientation, the chart manager will try to merge those labels based on the range information.
static String x_labels[] = {"Houston","Dallas","San Antonio", "Austin"};
...
XtVaCreateWidget("Cities", (WidgetClass)xintDataLabelObjectClass, edit,
XmNlabelStrings, x_labels,
XmNlabelCount, sizeof(x_labels)/sizeof(String),
XmNlabelOrientation, XintLABEL_X,
XmNdataGroup, data_group,
NULL);
| Name | Type | Default | Access |
|---|---|---|---|
| XmNcopyData | Boolean | True | CSG |
| XmNdataGroup | Object | NULL | CSG |
| XmNlabelCount | int | 0 | CSG |
| XmNlabelOrientation | int | XintLABEL_X | CSG |
| XmNlabelPositionArray | float * | NULL | CSG |
| XmNlabelStrings | char ** | NULL | CSG |
| XmNlastViewDestroy | Boolean | True | CSG |
| XmNsampledRange | XintRange * | NULL | CSG |
| XmNupdateCallback | XtCallbackList | NULL | C |
| Resource Value | Description |
|---|---|
| XintLABEL_X (default) | Label is associated with the X axis (column annotation). |
| XintLABEL_Y | Label is associated with the Y axis (row annotation). |
| XintLABEL_Z | Label is associated with the Z axis. |
This resource is specified as a pointer to a data structure of type XintRange, which takes the following form:
typedef struct {
float start;
float increment;
} XintRange;
where:
| Member | Description |
|---|---|
| start | Minimum value. |
| increment | Increment. |
typedef struct {
int reason;
XEvent *event;
Object object;
} XintDataLabelUpdateCallbackStruct;
If you have multiple DataLabel or other objects in a group, this callback must be registered separately for each individual data object. If you prefer to control updates at the group level, you should register this callback only once for the DataGroup object and use the XintDataGroupUpdateCallbackStruct discussed earlier in this manual.
The following ordered table describes the members of structure XintDataLabelUpdateCallbackStruct:
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why callback was invoked (see table below). |
| XEvent * | event | Standard member in Motif callback structure; not used in this context (will always be NULL). |
| Object | object | ID of the updated object. |
Member reason provides information explaining why and how the update occurred. Possible values for member reason are:
| Reason | Description |
|---|---|
| XintCR_DATA_UPDATE XintCR_DATA_BATCH | Label has been changed, no more information is available. |
| Function Name | Description |
|---|---|
| XintCreateDataLabel | Creates a DataLabel object. |
| XintDataLabelExtend | Extends the labels. |
| XintDataLabelReplace | Replaces the labels. |
| XintDataLabelShift | Shifts the labels. |
Object XintCreateDataLabel (...)
| Widget | parent | Parent of the new data label. |
| char * | name | Name of new data label object. |
| ArgList | arglist | List of resource settings for the new object. |
| Cardinal | argcount | Number of resources being set in arglist. |
Boolean XintDataLabelExtend (...)
| Object | object | Object ID of the label array to be extended. |
| String * | string_array | Array of strings to be added to the original label array. |
| float * | pos_array | Array of positions to be added to the original position array (Specify NULL if you are not using this field). |
| int | count | Number of values being added. |
Boolean XintDataLabelReplace(...)
| Object | object | Object ID of the label array to be replaced. |
| String * | string_array | Array of new strings to be used to replace existing labels. |
| float * | pos_array | Array of positions to be used to replace existing positions (Specify NULL if you are not using this field). |
| int | start | Index of first value to be replaced (starts at 0). |
| int | count | Number of values being replaced. |
Boolean XintDataLabelShift(...)
| Object | object | Object ID of the label array to be shifted. |
| String * | string_array | Array of new strings to be appended at the end of the list of labels. |
| float * | pos_array | Array of positions to be used to be appended at the end of the position list (Specify NULL if you are not using this field). |
| int | count | Number of values to be discarded at the front and appended to the end of the existing array. |
Boolean XintIsDataLabel (Object object)