2.2.3.8 Legend

A legend identifies different groupings of information about the chart (section 2.2.3.3). A legend consists of a set of legend entries. Each legend entry, which consists of a legend key and a text label, identifies either the data points (section 2.2.3.10) in the chart, the series (section 2.2.3.9) and trendlines in the chart, or the bands on a surface chart group (section 2.2.3.7).

A legend is specified by a sequence of records that conforms to an LD rule (section 2.1.7.20.1) in a chart group as specified by the chart sheet substream (section 2.1.7.20.1) ABNF.

A legend on a chart can contain three types of content:

  • A legend can contain legend entries for each of the series and trendlines in the chart:

    • Each legend entry represents a single series or trendline.

    • The legend keys contain the same formatting as the corresponding series or trendline.

    • The legend text labels contain the name of the corresponding series or trendline.

    • This type of legend is used when the chart group type is not surface and one of the following conditions is satisfied:

      • The chart has more than one included series.

      • The chart has a single included series, no data point formatting exceptions on the included series, and either contains a trendline or contains a ChartFormat record (section 2.4.48) associated with the included series that has the fVaried field equal to 0 or ignored.

  • A legend can contain legend entries for each data point in the chart:

    • Each legend entry represents a single data point on the chart.

    • The legend keys contain the same formatting as the corresponding data point.

    • The legend text labels contain the category (2) name or horizontal value of the corresponding data point.

    • This type of legend is used when the chart group type is not surface and the conditions for a legend that contains legend entries for each of the series and trendlines in the chart are not satisfied.

  • A legend can contain legend entries for each band on a surface chart group (which is formatted into different bands based on the value of the surface at any given data point in space):

    • Each legend entry represents a single band that represents a range of values on a surface chart group.

    • The legend keys contain the same formatting as the corresponding band.

    • The legend text labels contain the value range of the corresponding band.

    • This type of legend is used when the chart contains a surface chart group.

The following records and rules define the significant parts of a legend:

  • The Legend record (section 2.4.152) specifies the layout of the legend and specifies if the legend is automatically positioned.

  • The Pos record (section 2.4.201), CrtLayout12 record (section 2.4.66), and the sequence of records that conforms to the CRTMLFRT rule (section 2.1.7.20.1), specify the position of the legend.

  • The sequences of records that conform to the ATTACHEDLABEL (section 2.1.7.20.1) and TEXTPROPS (section 2.1.7.20.1) rules specify the default text formatting for the legend entries. The Pos record of the attached label (section 2.2.3.15) MUST be ignored. The ObjectLink record (section 2.4.182) of the attached label MUST NOT exist. A series can specify formatting exceptions for individual legend entries.

  • The sequence of records that conforms to the FRAME rule (section 2.1.7.20.1) specifies the fill and border formatting properties of the legend.