Databar Interface

Represents a data bar conditional formating rule. Applying a data bar to a range helps you see the value of a cell relative to other cells.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

public interface Databar

All conditional formatting objects are contained within a FormatConditions collection object, which is a child of a Range collection. You can create a data bar formatting rule by using either the Add(XlFormatConditionType, Object, Object, Object, Object, Object, Object, Object) or AddDatabar() method of the FormatConditions collection.

You use the MinPoint and MaxPoint properties of the Databar object to set the values of the shortest bar and longest bar of a range of data. These properites return a ConditionValue object, in which you can specify how the thresholds are evaluated.

The following example creates a range of data and then applies a data bar to the range. You will notice that because there is an extremely low and high value in the range, the middle values have data bars that are of similiar length. To disambiguate the middle values, the sample code uses the ConditionValue object to change how the thresholds are evaluated to percentiles.