Avoiding Overlapped Labels

All the charts that use the classic axis styles get their horizontal axis labels from the annotations of the data objects (usually from the first group plotted). These labels may be relatively long. You have several options for avoiding overprinting of axis labels.

By default, the axis labels are oriented horizontally. When overlapping is detected, one of the labels is hidden, not displayed. Often this results in every other or every third label being displayed. If the labels are of irregular length, irregular label spacing may result. Tick marks and grid lines are displayed for the hidden labels.

To have X or Y axis labels displayed in a staggered format, instead of simply being removed, in case of overlap, call SRGraphStyle::SetTierXLabels(TRUE) or SetTierYLabels(TRUE).

 

SRGraphDisplay* pD=new SRGraphDisplay;

pD->GetStyle()->SetTierXLabels(TRUE);

Another method of keeping the labels of the horizontal axis from overlapping is to orient them perpendicular to the axis line. To orient x-axis labels perpendicular to the axis line, call SRGraphStyle::SetXLCompatibility(FALSE).

 

SRGraphDisplay* pD=new SRGraphDisplay;

pD->GetStyle()->SetXLCompatibility(FALSE);

It is possible to specify other orientation angles using the techniques described in Overriding DrawXXXLabels()