Formatting the legend

Chart legend is a box to identify the patterns or colors assigned to the data categories in a chart. A chart legend may contain one or more legend entries, and each entry is composed of a mark and a label.

To format the legend of a chart:

  1. Right-click any chart element, and then select Format Legend from the shortcut menu to show the Format Legend dialog.
  2. In the Fill and Border tabs, set the fill and border modes for the legend (for details, refer to Formatting the platform).
  3. In the Placement tab, specify the way in which the legend will be placed.

    In the Position box, specify whether the legend will be placed at the left, right, top, or bottom of the chart, and then set the alignment style accordingly in the Alignment box. If Auto is selected, the legend will be placed somewhere automatically.

    In the Legend-Label Gap box, specify the vertical and horizontal margins between the legend entries and the legend boundaries, and the vertical and horizontal spacing between legend entry labels.

    Check the Reverse Legend checkbox to specify whether the legend entries will be re-arranged in a reverse order.

  4. In the Font tab, specify the font formats of the legend entry labels, including the font face, size, color, transparency, rotation angle, shearing angle, and effects such as style, strikeout, underline and so on.
  5. In the Orientation tab, set an angle for legend entry labels so as to rotate them. You can either drag the Text hand in the Orientation box or type a value in the Angle spinner to set the angle.
  6. In the Format tab, specify the data format of the legend entry labels. However, the settings in this tab take effect only when the property Label Format Source of the chart legend in the Report Inspector has been set to Legend Label Format.

    Select a category from the Category box, then select a format from the Format box and click Add to add it to the Stack box. You can add more than one format according to your requirements, and in the event that one of the formats is not necessary, you can clear it by clicking Remove.

  7. In the Mark tab, specify the options for formatting the legend entry marks.

    By default, JReport Designer uses 15 styles for the marks. To add a style, select a mark item from the Mark Items drop-down list, and then click to add it to the Mark Items box. The legend marks will repeat within the mark items you have defined. If you have defined more mark items than the actual legend marks, the redundant mark items will not be adopted. You can click , , or to remove a mark item, or to arrange the order of the these items.

    To change the style of a mark item, select it in the Mark Items box and then choose a new one from the Mark Items drop-down list. To change the fill mode of a mark item, select it and set the fill color/effect and the fill transparency in the Fill box.

    In the Icon box, you can specify the horizontal and vertical alignment styles, and gap between entry mark and entry label for the legend entry. You can also set the width and height for the legend entry marks. You can preview the effect real-timely in the Preview box.

  8. When done, click OK to apply the settings and close the dialog.

See also Format Legend dialog for detailed explanation about options in the dialog.