Legend Object Class


Overview

A Chart Object creates a Legend object when Chart resource XmNshowLegend is set to True. The following section describes the resources of the Legend object that you can use to customize its appearance. The labels used to annotate the legend correspond to the name of each series data object.

Inherited Behavior and Resources

The Legend object class inherits behavior and resources from the Xt Object and Graphic object classes.

The following resources are defined by the Legend object class:
NameTypeDefaultAccess
XmNiconWidthint15CSG
XmNcolumnsint1CSG
XmNlegendLocationXintLocation *NULLCSG
XmNlegendTitleStringNULLCSG
XmNlineStyleintXintLINE_NONECSG
XmNmarginHeightint8CSG
XmNmarginWidthint8CSG
XmNvisibleEntryCountint0CSG


XmNiconWidth

Specifies the size in pixels of the icon used to draw the series symbol.

XmNcolumns

Specifies the number of columns to use for the legend layout.

XmNlegendLocation

This resource is used to specify the position of the legend inside the chart. In most cases you should not use this resource directly but rather use the Chart constraint resource XmNconstraint. This resource is specified as a pointer to a data structure of type XintLocation which takes the following form:

   typedef struct {
                   float x;
                   float y;
   } XintLocation;

memberDescription
x, ySpecify the location of the center of the legend in the chart coordinate system (0 to 100 in both X and Y directions).


XmNlegendTitle

Specifies a title for the legend.

XmNlineStyle

Controls the line style for the rectangle that is drawn around the legend. The line color and line thickness are controlled by the Graphic resources XmNcolor and XmNlineThickness. You can specify one of the following constants for XmNlineStyle:

Resource ValueDescription
XintLINE_NONE (default)No rectangle is drawn.
XintLINE_SOLIDThe rectangle is drawn with a solid line.
XintLINE_ON_OFF_DASHThe rectangle is drawn with an on-off dash pattern.
XintLINE_DOUBLE_DASHThe rectangle is drawn with a double dash pattern.
XintSHADOW_INShadow is drawn so that legend appears inset.
XintSHADOW_OUTShadow is drawn so that legend appears outset.


XmNmarginHeight

Specifies the vertical margin for the legend in pixels.

XmNmarginWidth

Specifies the horizontal margin for the legend in pixels.

XmNvisibleEntryCount

Specifies the maximum number of entries that can be displayed by the legend. Specify 0 to have no limits.

Graphic Class Inherited Resources

Legend inherits behavior and resources from the Graphic class. The set of resources that can be accessed along with the proper defaults is listed below.

Graphic Class
NameTypeDefaultAccess
XmNcolorPixelforegroundCSG
XmNdashListchar *NULLCSG
XmNfillColorPixelbackgroundCSG
XmNfillFilenamechar *NULLCSG
XmNfillPixmapPixmapNULLCSG
XmNfillStyleintXintFILL_NONECSG
XmNfontchar *"*Helvetica*-120-*"CSG
XmNhighlightModeintXintHIGHLIGHT_HANDLECSG
XmNlineStyleintXintLINE_SOLIDCSG
XmNlineThicknessint1CSG
XmNmoveBooleanTrueCSG
XmNsensitiveBooleanTrueCSG
XmNshapeBooleanTrueCSG
XmNstippleColorPixelforegroundCSG


Macro

The XintIsLegend macro returns True if the specified object is a Legend object. It returns False otherwise.

     Boolean XintIsLegend (Object object)