[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

dataBar (Data Bar)

Describes a data bar conditional formatting rule.

[Example:

In this example a data bar conditional format is expressed, which spreads across all cell values in the cell range, and whose color is blue.

<dataBar>
<cfvo type="min" val="0"/>
<cfvo type="max" val="0"/>
<color rgb="FF638EC6"/>
</dataBar>

end example]

The length of the data bar for any cell can be calculated as follows:

Data bar length = minLength + (cell value - minimum value in the range) / (maximum value in the range - minimum value in the range) * (maxLength - minLength),

where min and max length are a fixed percentage of the column width (by default, 10% and 90% respectively.)

The minimum difference in length (or increment amount) is 1 pixel.

Parent Elements

cfRule3.3.1.9)

 

Child Elements

Subclause

cfvo (Conditional Format Value Object)

§3.3.1.10

color (Data Bar Color)

§3.3.1.14

 

Attributes

Description

maxLength (Maximum Length)

The maximum length of the data bar, as a percentage of the cell width.

 

The possible values for this attribute are defined by the XML Schema unsignedInt datatype.

minLength (Minimum Length)

The minimum length of the data bar, as a percentage of the cell width.

 

The possible values for this attribute are defined by the XML Schema unsignedInt datatype.

showValue (Show Values)

Indicates whether to show the values of the cells on which this data bar is applied.

 

The possible values for this attribute are defined by the XML Schema boolean datatype.

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_DataBar">

   <sequence>

   <element name="cfvo" type="CT_Cfvo" minOccurs="2" maxOccurs="2"/>

   <element name="color" type="CT_Color" minOccurs="1" maxOccurs="1"/>

   </sequence>

   <attribute name="minLength" type="xsd:unsignedInt" use="optional" default="10"/>

   <attribute name="maxLength" type="xsd:unsignedInt" use="optional" default="90"/>

   <attribute name="showValue" type="xsd:boolean" use="optional" default="true"/>

</complexType>