Scales / Labels / Scale Labels Layout
In This Topic
    Scale Labels Layout
    In This Topic

    After the scale generates and formats the labels it will layout them by placing each label at its initial position. When this happens one or more labels on the scale can overlap. Overlapping labels greatly reduce the readability and visual appeal of the scale and therefore it is essential that the scale resolves such overlapping.

    In NOV scales label overlapping is resolved by applying one or more label layout on each scale level until label overlapping is resolved or there are no more strategies to apply. This process is controlled from the LabelOverlapResolveLayouts property of the NScaleLabels object which accepts a dom array of ENLevelLabelsLayout values. The order in which you specify the layouts is important as layouts that appear first in the collection will be tested before the rest. If a layout succeeds the rest of the layout modes in the collection are ignored. By default the labels are configured to use staggering and then auto scaling. The following table lists the available layout strategies:

    ENLevelLabelsLayout Description
    Rotate30 Labels in the same level are rotated at 30 degrees
    Rotate45 Labels in the same level are rotated at 45 degrees
    Rotate90 Labels in the same level are rotated at 90 degrees
    Stagger2 Labels in the same level are staggered at two levels
    Stagger3 Labels in the same level are staggered at three levels
    RemoveOverlap Removes labels that overlap with other labels with higher Z order
    AutoScale Labels in the same level are scaled so that no overlapping occurs

    The following code shows how to apply automatic rotation to 90 degrees when the scale labels overlap:

    C#
    Copy Code
    scale.Labels.LabelOverlapResolveLayouts = new NDomArray<ENLevelLabelsLayout>(new ENLevelLabelsLayout[] { ENLevelLabelsLayout.Rotate90, ENLevelLabelsLayout.AutoScale });
    

    Note: It is a good idea to always leave the auto scale layout, because it will always resolve label overlapping.