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.getWorksheets().get(0).getCharts();
//Create a chart
var chart = charts.get(charts.add(ChartType.Column, 1, 1, 10, 10));
chart.getNSeries().add("A1:C5", true);

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

Methods

MethodDescription
getFillType()Gets and sets fill type
setFillType(FillType)Gets and sets fill type
getTransparency()Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
setTransparency(number)Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
getGradientFill()Gets GradientFill object.
getTextureFill()Gets TextureFill object.
getSolidFill()Gets SolidFill object.
getPatternFill()Gets PatternFill object.
getGradientColorType()Returns the gradient color type for the specified fill.
getGradientStyle()Returns the gradient style for the specified fill.
getGradientColor1()Returns the gradient color 1 for the specified fill.
getGradientColor2()Returns the gradient color 2 for the specified fill.
getGradientDegree()Returns the gradient degree for the specified fill. Only applies for Excel 2007.
getGradientVariant()Returns the gradient variant for the specified fill. Only applies for Excel 2007.
getPresetColor()Returns the gradient preset color for the specified fill.
getTexture()Represents the texture type for the specified fill.
setTexture(TextureType)Represents the texture type for the specified fill.
getPattern()Represents an area’s display pattern.
setPattern(FillPattern)Represents an area’s display pattern.
getPictureFormatType()Gets and sets the picture format type.
setPictureFormatType(FillPictureType)Gets and sets the picture format type.
getScale()Gets and sets the picture format scale.
setScale(number)Gets and sets the picture format scale.
getImageData()Gets and sets the picture image data.
setImageData(number[])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.
equals(object)
getHashCode()Gets the hash code.
isNull()Checks whether the implementation object is null.

getFillType()

Gets and sets fill type

getFillType() : FillType;

Returns

FillType

setFillType(FillType)

Gets and sets fill type

setFillType(value: FillType) : void;

Parameters:

ParameterTypeDescription
valueFillTypeThe value to set.

getTransparency()

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)

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()

Gets GradientFill object.

getGradientFill() : GradientFill;

Returns

GradientFill

getTextureFill()

Gets TextureFill object.

getTextureFill() : TextureFill;

Returns

TextureFill

getSolidFill()

Gets SolidFill object.

getSolidFill() : SolidFill;

Returns

SolidFill

getPatternFill()

Gets PatternFill object.

getPatternFill() : PatternFill;

Returns

PatternFill

getGradientColorType()

Returns the gradient color type for the specified fill.

getGradientColorType() : GradientColorType;

Returns

GradientColorType

getGradientStyle()

Returns the gradient style for the specified fill.

getGradientStyle() : GradientStyleType;

Returns

GradientStyleType

getGradientColor1()

Returns the gradient color 1 for the specified fill.

getGradientColor1() : Color;

Returns

Color

getGradientColor2()

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()

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()

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()

Returns the gradient preset color for the specified fill.

getPresetColor() : GradientPresetType;

Returns

GradientPresetType

getTexture()

Represents the texture type for the specified fill.

getTexture() : TextureType;

Returns

TextureType

setTexture(TextureType)

Represents the texture type for the specified fill.

setTexture(value: TextureType) : void;

Parameters:

ParameterTypeDescription
valueTextureTypeThe value to set.

getPattern()

Represents an area’s display pattern.

getPattern() : FillPattern;

Returns

FillPattern

setPattern(FillPattern)

Represents an area’s display pattern.

setPattern(value: FillPattern) : void;

Parameters:

ParameterTypeDescription
valueFillPatternThe value to set.

getPictureFormatType()

Gets and sets the picture format type.

getPictureFormatType() : FillPictureType;

Returns

FillPictureType

setPictureFormatType(FillPictureType)

Gets and sets the picture format type.

setPictureFormatType(value: FillPictureType) : void;

Parameters:

ParameterTypeDescription
valueFillPictureTypeThe value to set.

getScale()

Gets and sets the picture format scale.

getScale() : number;

setScale(number)

Gets and sets the picture format scale.

setScale(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getImageData()

Gets and sets the picture image data.

getImageData() : number[];

Returns

number[]

Remarks

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

setImageData(number[])

Gets and sets the picture image data.

setImageData(value: number[]) : 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.

equals(object)

equals(obj: object) : boolean;

Parameters:

ParameterTypeDescription
objobject

getHashCode()

Gets the hash code.

getHashCode() : number;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;