2.2.1.10 Data Label
A data label is a label on a chart that is associated with a data point, or with a series on an area or filled radar chart group. A data label contains information about the associated data point, such as the description of the data point, a legend key, or custom text.
Inheritance
The following is the order of inheritance that determines the contents of a data label associated with the data point:
Data labels can be specified for a chart group, specifying the default setting for the data labels associated with the data points on the chart group.
Data labels can be specified for a series, specifying the default setting for the data labels associated with the data points of the series. This type of data label overrides the data label properties specified on the chart group for the data labels associated with the data points in a series.
Data labels can be specified for a data point, specifying the settings for a data label associated with that data point. This type of data label overrides the data label properties specified on the chart group and series for the data labels associated with that data point.
Records
The set of records that specifies a data label, and the requirements that exist on these records, differ depending on whether the data label is specified for a chart group, series, or data point. The set of records that represent a data label are as follows:
For a chart group, properties of a data label are specified by the following collections of records that are specified in the chart group:
The sequence of records that conforms to the DFTTEXT rule.
The DataLabExtContents record that is not contained in the sequence of records that conforms to the LD or the sequence of records that conforms to the DFTTEXT rule.
The AttachedLabel record that is contained in the sequence of records that conforms to the SS rule.
For a series or data point, properties of a data label are specified by the following collections of records that are specified in the chart:
The attached label that corresponds to the series or data point. The attached label appears in the chart sheet substream after the axis group and is specified by the following properties of the attached label:
The wLinkObj field of the ObjectLink record is set to 0x0004.
The wLinkVar1 field of the ObjectLink record equals the index to the corresponding series.
The wLinkVar2 field of the ObjectLink record equals the index to the corresponding data point or is set to 0xFFFF for a corresponding series.
The AttachedLabel record that corresponds to the series or data point. The AttachedLabel record appears in the sequence of records that conforms to the SS rule that has the following properties:
The yi field of the DataFormat record equals the index to the corresponding series.
The xi field of the DataFormat record equals the index to the corresponding data point or is set to 0xFFFF for a corresponding series.
Overrides
Some properties of the records that specify the contents of a data label can overlap and conflict. For the information that overlaps between these records, there is a set of rules that specifies the relationships between these records and the fields to be ignored in conflict situations.
In general, properties of the DataLabExtContents record of the data label override properties of the Text record of the of the data label, which overrides the properties of the AttachedLabel record of the data label. Details of the relationships between individual fields are specified in the records.
The following section provides an explanation of how to interpret the data label and when the different records that specify the data label are relevant to the data label.
On a data label associated with a chart group:
When the chart group has a data label, the following algorithm determines the data label contents. Once the set of records that represents the data label has been established, the data label information that overlaps across records is respected on the DataLabExtContents record and ignored on the Text and AttachedLabel records of the data label. In this algorithm, ABNF rules are used to specify the sequence of records that conform to the rule. In this algorithm, "DFTTEXT with id" specifies the sequence of records that conforms to the DFTTEXT rule that contains a DefaultText record with an id field equal to the value specified.
//Define variables X equals a DataLabExtContents record Y equals a DataLabExtContents record SS equals an to AttachedLabel record SWAP equals a Boolean //Initialize SWAP SET SWAP equal to FALSE //Initialize SS SET SS equal to AttachedLabel record in the sequence of records that conforms to the SS rule //Initialize X IF DFTTEXT with id field equal to 0 exists IF DFTTEXT with id field equals to 0 has a DataLabExtContents record SET X equal to DataLabExtContents record in DFTTEXT with id field equal to 0 ELSE IF chart group type equals area or filled radar SET field fSerName of X equal to field fShowLabel of Text record in DFTTEXT with id field equal to 0 SET field fCatName of X equal to 0 ELSE SET field fCatName of X equal to field fShowLabel of Text record in DFTTEXT with id field equal to 0 SET field fSerName of X equal to 0 END IF SET field fValue of X equal to field fShowValue of Text record in DFTTEXT with id field equal to 0 SET field fPercent of X equal to field (fShowPercent OR fShowLabelAndPerc) of Text record in DFTTEXT with id field equal to 0 SET field fBubSizes of X equal to field fShowBubbleSizes of Text record in DFTTEXT with id field equal to 0 SET field RgchSet of X equal to NULL END IF ELSE SET field fCatName of X equal 1 SET fields fSerName, fValue, fPercent, fBubSizes of X equal to 0 SET field RgchSet of X equal to NULL END IF //Initialize Y IF DFTTEXT with id field equal to 1 exists IF DFTTEXT with id field equals to 1 has a DataLabExtContents record SET Y equal to DataLabExtContents record in DFTTEXT with id field equal to 1 ELSE IF chart group type equals area or filled radar SET field fSerName of Y equal to field (fShowLabel OR fShowLabelAndPerc) of Text record in DFTTEXT with id field equal to 1 SET field fCatName of Y equal to 0 ELSE SET field fCatName of Y equal to field (fShowLabel OR fShowLabelAndPerc) of Text record in DFTTEXT with id field equal to 1 SET field fSerName of Y equal to 0 END IF SET field fValue of Y equal to field fShowValue of Text record in DFTTEXT with id field equal to 1 SET field fPercent of Y equal to field (fShowPercent OR fShowLabelAndPerc) of Text record in DFTTEXT with id field equal to 1 SET field fBubSizes of Y equal to field fShowBubbleSizes of Text record in DFTTEXT with id field equal to 1 SET field RgchSet of X equal to NULL END IF ELSE SET field fValue of Y equal to 1 SET fields fCatName, fSerName, fPercent, fBubSizes of Y equal to 0 SET field RgchSet of X equal to NULL END IF //Modify X, Y, and SS IF (field fCatName of X equals 1) AND (fields fSerName, fValue, fPercent, AND fBubSizes of X equal 0) IF (field fShowValue of SS equals 1) AND (fields fShowPercent, fShowLabelAndPerc, fShowLabel, fShowBubbleSizes, AND fShowSeriesName of SS equal 0) IF (field fValue of Y equals 1) AND (fields fSerName, fCatName, fPercent, OR fBubSizes of Y equal 1) SET SWAP equals to TRUE SET field fValue of X equal to 1 SET fields fSerName, fCatName, fPercent, AND fBubSizes of X equal to 0 SET field fShowValue of SS equal to field fValue of Y SET field fShowPercent of SS equal to field fSPercent of Y SET field fShowLabel of SS equal to field fCatName of Y SET field fShowBubbleSizes of SS equal to field fBubSizes of Y SET field fShowSeriesName of SS equal to field fSerName of Y END IF ELSE IF ((field fShowPercent of SS equals 1) AND (field fShowBubbleSizes of SS equals 0)) OR ((field fShowPercent of SS equals 0) AND (field fShowBubbleSizes of SS equals 1)) AND (fields fShowLabelAndPerc, fShowLabel, fShowValue, AND fShowSeriesName of SS equal 0) SET SWAP equals to TRUE SET field fValue of X equal to 1 SET fields fSerName, fCatName, fPercent, AND fBubSizes of X equal to 0 SET field fShowValue of SS equal to field fValue of Y SET field fShowPercent of SS equal to field fSPercent of Y SET field fShowLabel of SS equal to field fCatName of Y SET field fShowBubbleSizes of SS equal to field fBubSizes of Y SET field fShowSeriesName of SS equal to field fSerName of Y ELSE IF (field fShowLabel of SS equals 1) AND (fields fShowPercent, fShowLabelAndPerc, fShowValue, fShowBubbleSizes, AND fShowSeriesName of SS equal 0) IF chart group type equals area or filled radar SET field fSerName of X equal to 1 SET fields fCatName, fValue, fPercent, AND fBubSizes equal to 0 SET field fShowValue of SS to 1 SET fields fShowPercent, fShowLabelAndPerc, fShowLabel, fShowBubbleSize, and fShowSeriesName of SS to 0 END IF SET field fValue of Y equals to 1 SET fields fSerName, fCatName, fPercent, AND fBubSizes of Y equal to 0 ELSE IF fields fShowLabel, fShowPercent, fShowLabelAndPerc, fShowValue, fShowBubbleSizes, AND fShowSeriesName of SS equal 0 IF chart group type equals area or filled radar SET fields fShowLabel of SS to 1 SET fields fShowPercent, fShowLabelAndPerc, fShowValue, fShowBubbleSize, and fShowSeriesName of SS to 0 END IF SET field fValue of Y equals to 1 SET fields fSerName, fCatName, fPercent, AND fBubSizes of Y equal to 0 END IF END IF END IF END IF ELSE IF (field fValue of Y equals 1) AND (fields fSerName, fCatName, fPercent, AND fBubSizes of Y equal 0) IF fields fShowLabel, fShowPercent, fShowLabelAndPerc, fShowValue, fShowBubbleSizes, AND fShowSeriesName of SS equal 0 IF (chart group type equals area or filled radar) AND (field fSerName of X equals 1) AND (fields fCatName, fValue, fPercent, AND fBubSizes of X equal 0) SET field fShowSeriesName of SS to 1 SET fields fShowPercent, fShowLabelAndPerc, fShowValue, fShowBubbleSize, and fShowLabel of SS to 0 ELSE SET field fCatName of X equals to 1 SET fields fSerName, fValue, fPercent, AND fBubSizes of X equal to 0 END IF ELSE IF (field fShowValue of SS equals 1) AND (fields fShowLabel, fShowPercent, fShowLabelAndPerc, fShowBubbleSizes, AND fShowSeriesName of SS equal 0) SET field fCatName of X equals to 1 SET fields fSerName, fValue, fPercent, AND fBubSizes of X equal to 0 ELSE SET field fShowValue of SS equal to field fValue of X SET field fShowPercent of SS equal to field fSPercent of X SET field fShowLabel of SS equal to field fCatName of X SET field fShowBubbleSizes of SS equal to field fBubSizes of X SET field fShowSeriesName of SS equal to field fSerName of X END IF END IF END IF END IF //Determine if X or Y is used IF (field fShowValue of SS equals 1) AND (fields fShowLabel, fShowPercent, fShowLabelAndPerc, fShowBubbleSizes, AND fShowSeriesName of SS equal 0) IF (SWAP equals FALSE) IF DFTTEXT with id field equal to 1 exists SET the data label equal to DFTTEXT with id field equal to 1 ELSE SET the data label equal to the default formatting properties END IF SET the DataLabExtContents record of the data label equal to Y ELSE IF DFTTEXT with id field equal to 0 exists SET the data label equal to DFTTEXT with id field equal to 0 ELSE SET the data label equal to the default formatting properties END IF SET the DataLabExtContents record of the data label equal to X END IF ELSE IF (SWAP equals FALSE) IF DFTTEXT with id field equal to 0 exists SET the data label equal to DFTTEXT with id field equal to 0 ELSE SET the data label equal to the default formatting properties END IF SET the DataLabExtContents record of the data label equal to X ELSE IF DFTTEXT with id field equal to 1 exists SET the data label equal to DFTTEXT with id field equal to 1 ELSE SET the data label equal to the default formatting properties END IF SET the DataLabExtContents record of the data label equal to Y END IF END IF
On a data label associated with a series or data point:
The attached label specifies an exception on the data label and indicates that the current data label differs from the data label inherited from the chart group for a series, or from the chart group and series for a data point. The attached label of the data label contains a Text record and can contain a DataLabExtContents record.
On a data label associated with a data point, when the attached label exists and contains a SeriesText record and a BRAI record with field formula set to 0x0000, the SeriesText record specifies the contents of the data label.
When the attached label exists and contains a DataLabExtContents record, the data label information specified by the DataLabExtContents record that overlaps across records is respected, and the information contained in the Text and AttachedLabel records of the data label that overlaps is ignored.
When the attached label exists and does not contain a DataLabExtContents record, the data label specified by the Text record that overlaps across records is respected, and the information contained in the AttachedLabel record of the data label that overlaps is ignored.
When the data label does not specify an attached label, the AttachedLabel record of the data label specifies the content properties of the data label.
Restrictions
The following requirements and restrictions exist on parts of the collections of records that represent the data label.
If the chart group contains a data label:
The chart group SHOULD<3> contain two sequences of records that conform to the DFTTEXT rule that have the same records with the same field values.
If the chart group contains a DataLabExtContents record, the DataLabExtContents record in the sequences of records that conform to the DFTTEXT rule on the chart group and the DataLabExtContents record that is not specified in the sequences of records that conform to the DFTTEXT rule on the chart group SHOULD<4> contain the same field values.
If the chart group contains a sequence of records that conforms to the DFTTEXT rule, the following restrictions apply:
The fShowValue field of the AttachedLabel record SHOULD<5> equal the fShowValue field of the Text record in the sequence of records that conforms to the DFTTEXT rule.
The fShowPercent field of the AttachedLabel record SHOULD<6> equal the fShowPercent field of the Text record in the sequence of records that conforms to the DFTTEXT rule.
The fShowLabelAndPerc field of the AttachedLabel record SHOULD<7> equal the fShowLabelAndPerc field of the Text record in the sequence of records that conforms to the DFTTEXT rule.
The fShowLabel field of the AttachedLabel record SHOULD<8> equal the fShowLabel field of the Text record in the sequence of records that conforms to the DFTTEXT rule.
The fShowBubbleSizes field of the AttachedLabel record SHOULD<9> equal the fShowBubbleSizes field of the Text record in the sequence of records that conforms to the DFTTEXT rule.
If the chart group contains a DataLabExtContents record and the chart group type is not area or filled radar, the fShowSeriesName field of the AttachedLabel record SHOULD<10> equal the fSerName field of the DataLabExtContents record. Otherwise, the fShowSeriesName field of the AttachedLabel record SHOULD<11> be set to zero.
The fAutoText field of the Text record in the sequence of records that conforms to the DFTTEXT rule MUST be set to 1.
The DataLabExtContents record MUST exist on a data label if, and only if, at least one of the following conditions is satisfied:
Non-Area Series Only: All of the following conditions are satisfied:
The chart group type of the associated chart group, series, or data point is not area or filled radar.
The data label shows only the series name, and the DataLabExtContents record has the following state:
fSerName is set to 1.
fBubSizes, fCatName, fPercent, and fValue are set to zero.
Area Category Only: All of the following conditions are satisfied:
The chart group type of the associated chart group, series, or data point is area or filled radar.
The data label only shows the category name, and the DataLabExtContents record has the following state:
fCatName is set to 1.
fBubSizes, fPercent, fSerName, and fValue is set to zero.
Label and Percent with Non-Null Separator: All of the following conditions are satisfied:
The data label shows only the label and percent, and the DataLabExtContents record has the following state:
fCatName and fPercent is set to 1.
fBubSizes, fSerName, and fValue is set to zero.
The data label has a non-NULL separator, and the rgchSep field of the DataLabExtContents record is not equal to NULL.
Combo Other Than Label and Percent: All of the following conditions are satisfied:
The data label shows more than one type of content, other than label and percent, and the fields of the DataLabExtContents record satisfy at least one of the following conditions:
fCatName or fPercent is set to 1, and fBubSizes, fSerName, or fValue is set to 1.
fBubSize equals 1, and fSerName or fValue is set to 1.
fSerName and fValue is set to 1.
The optional DataLabExt, StartObject, and EndObject records MUST exist in the chart sheet substream if, and only if, the attached label contained between the StartObject and EndObject records satisfies one of the following conditions:
The Non-Area Series Only case specified previously.
The Area Category Only case specified previously.