Search Locate Previous Contents

Using Autofit with Keys

When you set up your chart frame and margins, RainPro defaults to using the available space in the bottom margin to write any key (or legend) text. You may override this by setting an explicit key frame, but sometimes it is hard to calculate exactly how much space you need, as the key text may be coming from a database system which is outside your control.

This key style allows you to set up a reasonable key font and frame, and have RainPro adjust the font (downwards only) to ensure all your legends fit in the allowed space. If you want to force an exact fit regardless (for example into a vertical frame) set a font size a little bigger than you really need so that RainPro sizes it down for you. The font is adjusted in 0.25 point decrements, so do not choose a very large size, as this will run the key-fitting code many times before the correct size is chosen.

Example of autofit
This example shows a vertical (reversed) key, which has been set to 10-point Arial.

As you can see, several of the texts are missing (having overflowed the allowed frame at the bottom) and also some words spill out of the right-hand side of the frame. If we enable the ‘autofit’ style on the key, the chart will look like:

As a final test, we can make the frame a little narrower, which constrains the text further and leaves some spare white space at the bottom of the key.

The text will not be reduced below 3pt in size – if the key does not fit at this size it will be truncated as before.

See also ...
KeyFrame – key frame override
Key – legends for key
KeyFont – key font

© Copyright Causeway Graphical Systems Ltd 2003