Plot.SetAxisTickLabelFitPolicy

Prototypes

void SetAxisTickLabelFitPolicy( int nAxisID, int nTickLabelFitPolicy )

Parameters

int nAxisID
A predefined constant specifying the axis. The only valid value is XAXIS.

int nTickLabelFitPolicy
A predefined constant specifying the tick label fit policy for the axis. See Remarks for details. If you call this method with nTickLabelFitPolicy equal to -1, the plot silently ignores the call.

Remarks

This method sets the tick label fit policy for an axis. The tick label fit policy controls the appearance of tick labels when there is insufficient room for the plot to display all the labels using standard horizontal text.

The parameter nTickLabelFitPolicy is a predefined constant that specifies the tick label fit policy. The predefined constants for this parameter are as follows:

TLFP_ROTATE
Under this policy the plot first attempts to display the tick labels using standard horizontal text. If some labels collide, the plot displays the labels by rotating all of them 90 degrees counter-clockwise. If a label would collide with its neighbors, the plot does not display that label.

TLFP_THIN
Under this policy the plot displays the tick labels using standard horizontal text. If a label would collide with its neighbors, the plot does not display that label.

TLFP_ALWAYSROTATE
Under this policy the plot displays the tick labels by rotating them 90 degrees counter-clockwise. If a label would collide with its neighbors, the plot does not display that label.

TLFP_REFITONLY
This constant instructs the plot to refit both the X and Y axes but not to change the tick label fit policy. See below for details.

When you call this method with the parameter nTickLabelFitPolicy set to a value other than -1, the plot updates the tick label fit policy and then refits both the X and Y axes. Refitting the axes means adjusting the Graph Area margins so there is sufficient room for the axes to be displayed without running off the edge of the Graph Area.

By default, all 2D plots use the policy TLFP_ROTATE. The 3D plot does not perform tick label collision avoidance and the RotatingPlot class does not support the method SetAxisTickLabelFitPolicy.

Example
declare DataObject dobj;
dobj = DataObject.CreateFromFile( "baseball" );
declare ScatterPlot plot;
plot = ScatterPlot.Create( dobj, "no_atbat", "no_home", false );
plot.SetAxisTickLabelFitPolicy( XAXIS, TLFP_ALWAYSROTATE );
plot.ShowWindow();