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
var lime = new Color(0x32, 0xcd, 0x32);
chart.getNSeries().get(1).getArea().getFillFormat().setOneColorGradient(lime, 1, GradientStyleType.Horizontal, 1);
Methods
Method | Description |
---|---|
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
setFillType(FillType)
Gets and sets fill type
setFillType(value: FillType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | FillType | The 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:
Parameter | Type | Description |
---|---|---|
value | number | The value to set. |
getGradientFill()
Gets GradientFill object.
getGradientFill() : GradientFill;
Returns
getTextureFill()
Gets TextureFill object.
getTextureFill() : TextureFill;
Returns
getSolidFill()
Gets SolidFill object.
getSolidFill() : SolidFill;
Returns
getPatternFill()
Gets PatternFill object.
getPatternFill() : PatternFill;
Returns
getGradientColorType()
Returns the gradient color type for the specified fill.
getGradientColorType() : GradientColorType;
Returns
getGradientStyle()
Returns the gradient style for the specified fill.
getGradientStyle() : GradientStyleType;
Returns
getGradientColor1()
Returns the gradient color 1 for the specified fill.
getGradientColor1() : Color;
Returns
getGradientColor2()
Returns the gradient color 2 for the specified fill.
getGradientColor2() : Color;
Returns
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
getTexture()
Represents the texture type for the specified fill.
getTexture() : TextureType;
Returns
setTexture(TextureType)
Represents the texture type for the specified fill.
setTexture(value: TextureType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | TextureType | The value to set. |
getPattern()
Represents an area’s display pattern.
getPattern() : FillPattern;
Returns
setPattern(FillPattern)
Represents an area’s display pattern.
setPattern(value: FillPattern) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | FillPattern | The value to set. |
getPictureFormatType()
Gets and sets the picture format type.
getPictureFormatType() : FillPictureType;
Returns
setPictureFormatType(FillPictureType)
Gets and sets the picture format type.
setPictureFormatType(value: FillPictureType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | FillPictureType | The 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:
Parameter | Type | Description |
---|---|---|
value | number | The 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:
Parameter | Type | Description |
---|---|---|
value | number[] | 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:
Parameter | Type | Description |
---|---|---|
color | Color | One gradient color. |
degree | number | The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light). |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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:
Parameter | Type | Description |
---|---|---|
color1 | Color | One gradient color. |
color2 | Color | Two gradient color. |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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:
Parameter | Type | Description |
---|---|---|
color1 | Color | One gradient color. |
transparency1 | number | The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear). |
color2 | Color | Two gradient color. |
transparency2 | number | The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear). |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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:
Parameter | Type | Description |
---|---|---|
presetColor | GradientPresetType | Preset color type |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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:
Parameter | Type | Description |
---|---|---|
obj | object |
getHashCode()
Gets the hash code.
getHashCode() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;