When a chart draws a large data set or contains lengthy
labels and titles, chart objects may overlap and obscure objects
behind them. In the following example, the ordinal axis/group labels
and series labels are long and overlap each other.
The chart layout manager can automatically correct this problem
with a single property.
Additionally, Perspective includes methods that allow you to
enable/disable and define how automatic chart layout is done for
individual objects.
The Place property enables/disables the automatic chart layout
manager. This functionality allows you to automatically setup the
spacing of various elements of a chart. Prior to drawing a chart,
certain Perspective methods may be set depending on what the automatic
chart layout manager determines the optimum chart to be.
When setPlace (true) is used, you can use the following methods
to further control automatic placement of chart elements:
- setPlaceAlign();
For any text object, allow/disallow horizontal alignment. By default,
horizontal alignment is allowed.
- setPlaceMargin();
Define the margin to draw around the entire chart. The default value
is default new Rectangle (-15500, -15500, 31000, 31000).
- setPlaceMaxNumWordWrapLines();
For any text object, define the maximum number of lines that can
be wrapped when setPlaceWordWrap() is enabled. The default value
is 2.
- setPlaceMinFontSize();
For any text object, define the minimum font size that can be used
by the automatic chart layout manager to resize a text object. The
default value is 4 point.
- setPlacePosition();
Define how the automatic chart layout manager can position objects.
In the current implementation, only the legend object can be repositioned.
The default value is zero.
- setPlaceRect();
Set the rectangle to be used for initial placement of objects. In
the current implementation, only object IDs return by getPlaceVertO1LabelsTitle()
or getPlaceHorzO1LabelsTitle() can be used.
- setPlaceResize();
For any chart object, allow/disallow the automatic chart layout manager
to move/resize the object. By default, resizing of all chart objects
is allowed.
- setPlaceRotate();
For any text object, allow/disallow the automatic chart layout manager
to rotate the object. By default, rotation is allowed for all text
objects.
- setPlaceSkip();
For primary ordinal axis (O1) labels, allow/disallow the automatic chart
layout manager to skip labels. By default, label skipping is allowed.
- setPlaceTruncateCount();
For any text object, set the number of characters that can be truncated.
- setPlaceWordWrap();
For any text object, allow/disallow word wrapping. By default, word
wrapping is allowed.