DataBar

DataBar class

Describe the DataBar conditional formatting rule. This conditional formatting rule displays a gradated data bar in the range of cells.

class DataBar;

Methods

MethodDescription
getAxisColor()Gets the color of the axis for cells with conditional formatting as data bars.
setAxisColor(Color)Gets the color of the axis for cells with conditional formatting as data bars.
getAxisPosition()Gets or sets the position of the axis of the data bars specified by a conditional formatting rule.
setAxisPosition(DataBarAxisPosition)Gets or sets the position of the axis of the data bars specified by a conditional formatting rule.
getBarFillType()Gets or sets how a data bar is filled with color.
setBarFillType(DataBarFillType)Gets or sets how a data bar is filled with color.
getDirection()Gets or sets the direction the databar is displayed.
setDirection(TextDirectionType)Gets or sets the direction the databar is displayed.
getBarBorder()Gets an object that specifies the border of a data bar.
getNegativeBarFormat()Gets the NegativeBarFormat object associated with a data bar conditional formatting rule.
getMinCfvo()Get or set this DataBar’s min value object. Cannot set null or CFValueObject with type FormatConditionValueType.Max to it.
getMaxCfvo()Get or set this DataBar’s max value object. Cannot set null or CFValueObject with type FormatConditionValueType.Min to it.
getColor()Get or set this DataBar’s Color.
setColor(Color)Get or set this DataBar’s Color.
getMinLength()Represents the min length of data bar .
setMinLength(number)Represents the min length of data bar .
getMaxLength()Represents the max length of data bar .
setMaxLength(number)Represents the max length of data bar .
getShowValue()Get or set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.
setShowValue(boolean)Get or set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.
toImage(Cell, ImageOrPrintOptions)Render data bar in cell to image byte array.

getAxisColor()

Gets the color of the axis for cells with conditional formatting as data bars.

getAxisColor() : Color;

Returns

Color

setAxisColor(Color)

Gets the color of the axis for cells with conditional formatting as data bars.

setAxisColor(value: Color) : void;

Parameters:

ParameterTypeDescription
valueColorThe value to set.

getAxisPosition()

Gets or sets the position of the axis of the data bars specified by a conditional formatting rule.

getAxisPosition() : DataBarAxisPosition;

Returns

DataBarAxisPosition

setAxisPosition(DataBarAxisPosition)

Gets or sets the position of the axis of the data bars specified by a conditional formatting rule.

setAxisPosition(value: DataBarAxisPosition) : void;

Parameters:

ParameterTypeDescription
valueDataBarAxisPositionThe value to set.

getBarFillType()

Gets or sets how a data bar is filled with color.

getBarFillType() : DataBarFillType;

Returns

DataBarFillType

setBarFillType(DataBarFillType)

Gets or sets how a data bar is filled with color.

setBarFillType(value: DataBarFillType) : void;

Parameters:

ParameterTypeDescription
valueDataBarFillTypeThe value to set.

getDirection()

Gets or sets the direction the databar is displayed.

getDirection() : TextDirectionType;

Returns

TextDirectionType

setDirection(TextDirectionType)

Gets or sets the direction the databar is displayed.

setDirection(value: TextDirectionType) : void;

Parameters:

ParameterTypeDescription
valueTextDirectionTypeThe value to set.

getBarBorder()

Gets an object that specifies the border of a data bar.

getBarBorder() : DataBarBorder;

Returns

DataBarBorder

getNegativeBarFormat()

Gets the NegativeBarFormat object associated with a data bar conditional formatting rule.

getNegativeBarFormat() : NegativeBarFormat;

Returns

NegativeBarFormat

getMinCfvo()

Get or set this DataBar’s min value object. Cannot set null or CFValueObject with type FormatConditionValueType.Max to it.

getMinCfvo() : ConditionalFormattingValue;

Returns

ConditionalFormattingValue

getMaxCfvo()

Get or set this DataBar’s max value object. Cannot set null or CFValueObject with type FormatConditionValueType.Min to it.

getMaxCfvo() : ConditionalFormattingValue;

Returns

ConditionalFormattingValue

getColor()

Get or set this DataBar’s Color.

getColor() : Color;

Returns

Color

setColor(Color)

Get or set this DataBar’s Color.

setColor(value: Color) : void;

Parameters:

ParameterTypeDescription
valueColorThe value to set.

getMinLength()

Represents the min length of data bar .

getMinLength() : number;

setMinLength(number)

Represents the min length of data bar .

setMinLength(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getMaxLength()

Represents the max length of data bar .

getMaxLength() : number;

setMaxLength(number)

Represents the max length of data bar .

setMaxLength(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getShowValue()

Get or set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.

getShowValue() : boolean;

setShowValue(boolean)

Get or set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.

setShowValue(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

toImage(Cell, ImageOrPrintOptions)

Render data bar in cell to image byte array.

toImage(cell: Cell, imgOpts: ImageOrPrintOptions) : number[];

Parameters:

ParameterTypeDescription
cellCellIndicate the data bar in which cell to be rendered
imgOptsImageOrPrintOptionsImageOrPrintOptions contains some property of output image

Returns

number[]