FillFormat

FillFormat class

Encapsulates the object that represents fill formatting for a shape.

class FillFormat;

Example

const { Workbook, ChartType, Color, GradientStyleType } = require("aspose.cells.node");

var excel = new Workbook();
var charts = excel.worksheets.get(0).charts;
//Create a chart
var chart = charts.get(charts.add(ChartType.Column, 1, 1, 10, 10));
chart.nSeries.add("A1:C5", true);

//Filling the area of the 2nd NSeries with a gradient
chart.nSeries.get(1).area.fillFormat.setOneColorGradient(Color.Lime, 1, GradientStyleType.Horizontal, 1);

Properties

PropertyTypeDescription
fillTypeFillTypeGets and sets fill type
transparencynumberReturns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
gradientFillGradientFillReadonly. Gets GradientFill object.
textureFillTextureFillReadonly. Gets TextureFill object.
solidFillSolidFillReadonly. Gets SolidFill object.
patternFillPatternFillReadonly. Gets PatternFill object.
gradientColorTypeGradientColorTypeReadonly. Returns the gradient color type for the specified fill.
gradientStyleGradientStyleTypeReadonly. Returns the gradient style for the specified fill.
gradientColor1ColorReadonly. Returns the gradient color 1 for the specified fill.
gradientColor2ColorReadonly. Returns the gradient color 2 for the specified fill.
gradientDegreenumberReadonly. Returns the gradient degree for the specified fill. Only applies for Excel 2007.
gradientVariantnumberReadonly. Returns the gradient variant for the specified fill. Only applies for Excel 2007.
presetColorGradientPresetTypeReadonly. Returns the gradient preset color for the specified fill.
textureTextureTypeRepresents the texture type for the specified fill.
patternFillPatternRepresents an area’s display pattern.
pictureFormatTypeFillPictureTypeGets and sets the picture format type.
scalenumberGets and sets the picture format scale.
imageDataUint8ArrayGets and sets the picture image data.

Methods

MethodDescription
getFillType()@deprecated. Please use the ‘fillType’ property instead. Gets and sets fill type
setFillType(FillType)@deprecated. Please use the ‘fillType’ property instead. Gets and sets fill type
getTransparency()@deprecated. Please use the ’transparency’ property instead. Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
setTransparency(number)@deprecated. Please use the ’transparency’ property instead. Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
getGradientFill()@deprecated. Please use the ‘gradientFill’ property instead. Gets GradientFill object.
getTextureFill()@deprecated. Please use the ’textureFill’ property instead. Gets TextureFill object.
getSolidFill()@deprecated. Please use the ‘solidFill’ property instead. Gets SolidFill object.
getPatternFill()@deprecated. Please use the ‘patternFill’ property instead. Gets PatternFill object.
getGradientColorType()@deprecated. Please use the ‘gradientColorType’ property instead. Returns the gradient color type for the specified fill.
getGradientStyle()@deprecated. Please use the ‘gradientStyle’ property instead. Returns the gradient style for the specified fill.
getGradientColor1()@deprecated. Please use the ‘gradientColor1’ property instead. Returns the gradient color 1 for the specified fill.
getGradientColor2()@deprecated. Please use the ‘gradientColor2’ property instead. Returns the gradient color 2 for the specified fill.
getGradientDegree()@deprecated. Please use the ‘gradientDegree’ property instead. Returns the gradient degree for the specified fill. Only applies for Excel 2007.
getGradientVariant()@deprecated. Please use the ‘gradientVariant’ property instead. Returns the gradient variant for the specified fill. Only applies for Excel 2007.
getPresetColor()@deprecated. Please use the ‘presetColor’ property instead. Returns the gradient preset color for the specified fill.
getTexture()@deprecated. Please use the ’texture’ property instead. Represents the texture type for the specified fill.
setTexture(TextureType)@deprecated. Please use the ’texture’ property instead. Represents the texture type for the specified fill.
getPattern()@deprecated. Please use the ‘pattern’ property instead. Represents an area’s display pattern.
setPattern(FillPattern)@deprecated. Please use the ‘pattern’ property instead. Represents an area’s display pattern.
getPictureFormatType()@deprecated. Please use the ‘pictureFormatType’ property instead. Gets and sets the picture format type.
setPictureFormatType(FillPictureType)@deprecated. Please use the ‘pictureFormatType’ property instead. Gets and sets the picture format type.
getScale()@deprecated. Please use the ‘scale’ property instead. Gets and sets the picture format scale.
setScale(number)@deprecated. Please use the ‘scale’ property instead. Gets and sets the picture format scale.
getImageData()@deprecated. Please use the ‘imageData’ property instead. Gets and sets the picture image data.
setImageData(Uint8Array)@deprecated. Please use the ‘imageData’ property instead. Gets and sets the picture image data.
setOneColorGradient(Color, number, GradientStyleType, number)Sets the specified fill to a one-color gradient. Only applies for Excel 2007.
setTwoColorGradient(Color, Color, GradientStyleType, number)Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
setTwoColorGradient(Color, number, Color, number, GradientStyleType, number)Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
setPresetColorGradient(GradientPresetType, GradientStyleType, number)Sets the specified fill to a preset-color gradient. Only applies for Excel 2007.
isNull()Checks whether the implementation object is null.
equals(Object)
getHashCode()Gets the hash code.

fillType

Gets and sets fill type

fillType : FillType;

transparency

Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).

transparency : number;

gradientFill

Readonly. Gets GradientFill object.

gradientFill : GradientFill;

textureFill

Readonly. Gets TextureFill object.

textureFill : TextureFill;

solidFill

Readonly. Gets SolidFill object.

solidFill : SolidFill;

patternFill

Readonly. Gets PatternFill object.

patternFill : PatternFill;

gradientColorType

Readonly. Returns the gradient color type for the specified fill.

gradientColorType : GradientColorType;

gradientStyle

Readonly. Returns the gradient style for the specified fill.

gradientStyle : GradientStyleType;

gradientColor1

Readonly. Returns the gradient color 1 for the specified fill.

gradientColor1 : Color;

gradientColor2

Readonly. Returns the gradient color 2 for the specified fill.

gradientColor2 : Color;

Remarks

Only when the gradient color type is GradientColorType.TwoColors, this property is meaningful.

gradientDegree

Readonly. Returns the gradient degree for the specified fill. Only applies for Excel 2007.

gradientDegree : number;

Remarks

Can only be a value from 0.0 (dark) through 1.0 (light).

gradientVariant

Readonly. Returns the gradient variant for the specified fill. Only applies for Excel 2007.

gradientVariant : number;

Remarks

Can only be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

presetColor

Readonly. Returns the gradient preset color for the specified fill.

presetColor : GradientPresetType;

texture

Represents the texture type for the specified fill.

texture : TextureType;

pattern

Represents an area’s display pattern.

pattern : FillPattern;

pictureFormatType

Gets and sets the picture format type.

pictureFormatType : FillPictureType;

scale

Gets and sets the picture format scale.

scale : number;

imageData

Gets and sets the picture image data.

imageData : Uint8Array;

Remarks

If the fill format is not custom texture format, returns null.

getFillType()

@deprecated. Please use the ‘fillType’ property instead. Gets and sets fill type

getFillType() : FillType;

Returns

FillType

setFillType(FillType)

@deprecated. Please use the ‘fillType’ property instead. Gets and sets fill type

setFillType(value: FillType) : void;

Parameters:

ParameterTypeDescription
valueFillTypeThe value to set.

getTransparency()

@deprecated. Please use the ’transparency’ property instead. Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).

getTransparency() : number;

setTransparency(number)

@deprecated. Please use the ’transparency’ property instead. Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).

setTransparency(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getGradientFill()

@deprecated. Please use the ‘gradientFill’ property instead. Gets GradientFill object.

getGradientFill() : GradientFill;

Returns

GradientFill

getTextureFill()

@deprecated. Please use the ’textureFill’ property instead. Gets TextureFill object.

getTextureFill() : TextureFill;

Returns

TextureFill

getSolidFill()

@deprecated. Please use the ‘solidFill’ property instead. Gets SolidFill object.

getSolidFill() : SolidFill;

Returns

SolidFill

getPatternFill()

@deprecated. Please use the ‘patternFill’ property instead. Gets PatternFill object.

getPatternFill() : PatternFill;

Returns

PatternFill

getGradientColorType()

@deprecated. Please use the ‘gradientColorType’ property instead. Returns the gradient color type for the specified fill.

getGradientColorType() : GradientColorType;

Returns

GradientColorType

getGradientStyle()

@deprecated. Please use the ‘gradientStyle’ property instead. Returns the gradient style for the specified fill.

getGradientStyle() : GradientStyleType;

Returns

GradientStyleType

getGradientColor1()

@deprecated. Please use the ‘gradientColor1’ property instead. Returns the gradient color 1 for the specified fill.

getGradientColor1() : Color;

Returns

Color

getGradientColor2()

@deprecated. Please use the ‘gradientColor2’ property instead. Returns the gradient color 2 for the specified fill.

getGradientColor2() : Color;

Returns

Color

Remarks

Only when the gradient color type is GradientColorType.TwoColors, this property is meaningful.

getGradientDegree()

@deprecated. Please use the ‘gradientDegree’ property instead. Returns the gradient degree for the specified fill. Only applies for Excel 2007.

getGradientDegree() : number;

Remarks

Can only be a value from 0.0 (dark) through 1.0 (light).

getGradientVariant()

@deprecated. Please use the ‘gradientVariant’ property instead. Returns the gradient variant for the specified fill. Only applies for Excel 2007.

getGradientVariant() : number;

Remarks

Can only be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

getPresetColor()

@deprecated. Please use the ‘presetColor’ property instead. Returns the gradient preset color for the specified fill.

getPresetColor() : GradientPresetType;

Returns

GradientPresetType

getTexture()

@deprecated. Please use the ’texture’ property instead. Represents the texture type for the specified fill.

getTexture() : TextureType;

Returns

TextureType

setTexture(TextureType)

@deprecated. Please use the ’texture’ property instead. Represents the texture type for the specified fill.

setTexture(value: TextureType) : void;

Parameters:

ParameterTypeDescription
valueTextureTypeThe value to set.

getPattern()

@deprecated. Please use the ‘pattern’ property instead. Represents an area’s display pattern.

getPattern() : FillPattern;

Returns

FillPattern

setPattern(FillPattern)

@deprecated. Please use the ‘pattern’ property instead. Represents an area’s display pattern.

setPattern(value: FillPattern) : void;

Parameters:

ParameterTypeDescription
valueFillPatternThe value to set.

getPictureFormatType()

@deprecated. Please use the ‘pictureFormatType’ property instead. Gets and sets the picture format type.

getPictureFormatType() : FillPictureType;

Returns

FillPictureType

setPictureFormatType(FillPictureType)

@deprecated. Please use the ‘pictureFormatType’ property instead. Gets and sets the picture format type.

setPictureFormatType(value: FillPictureType) : void;

Parameters:

ParameterTypeDescription
valueFillPictureTypeThe value to set.

getScale()

@deprecated. Please use the ‘scale’ property instead. Gets and sets the picture format scale.

getScale() : number;

setScale(number)

@deprecated. Please use the ‘scale’ property instead. Gets and sets the picture format scale.

setScale(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getImageData()

@deprecated. Please use the ‘imageData’ property instead. Gets and sets the picture image data.

getImageData() : Uint8Array;

Remarks

If the fill format is not custom texture format, returns null.

setImageData(Uint8Array)

@deprecated. Please use the ‘imageData’ property instead. Gets and sets the picture image data.

setImageData(value: Uint8Array) : void;

Parameters:

ParameterTypeDescription
valuenumber[]The value to set.

Remarks

If the fill format is not custom texture format, returns null.

setOneColorGradient(Color, number, GradientStyleType, number)

Sets the specified fill to a one-color gradient. Only applies for Excel 2007.

setOneColorGradient(color: Color, degree: number, style: GradientStyleType, variant: number) : void;

Parameters:

ParameterTypeDescription
colorColorOne gradient color.
degreenumberThe gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).
styleGradientStyleTypeGradient shading style.
variantnumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setTwoColorGradient(Color, Color, GradientStyleType, number)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

setTwoColorGradient(color1: Color, color2: Color, style: GradientStyleType, variant: number) : void;

Parameters:

ParameterTypeDescription
color1ColorOne gradient color.
color2ColorTwo gradient color.
styleGradientStyleTypeGradient shading style.
variantnumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setTwoColorGradient(Color, number, Color, number, GradientStyleType, number)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

setTwoColorGradient(color1: Color, transparency1: number, color2: Color, transparency2: number, style: GradientStyleType, variant: number) : void;

Parameters:

ParameterTypeDescription
color1ColorOne gradient color.
transparency1numberThe degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).
color2ColorTwo gradient color.
transparency2numberThe degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).
styleGradientStyleTypeGradient shading style.
variantnumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setPresetColorGradient(GradientPresetType, GradientStyleType, number)

Sets the specified fill to a preset-color gradient. Only applies for Excel 2007.

setPresetColorGradient(presetColor: GradientPresetType, style: GradientStyleType, variant: number) : void;

Parameters:

ParameterTypeDescription
presetColorGradientPresetTypePreset color type
styleGradientStyleTypeGradient shading style.
variantnumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

isNull()

Checks whether the implementation object is null.

isNull() : boolean;

equals(Object)

equals(obj: Object) : boolean;

Parameters:

ParameterTypeDescription
objObject

getHashCode()

Gets the hash code.

getHashCode() : number;