public class FillFormat
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.getWorksheets().add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.getCells().get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "A4" cell
worksheet.getCells().get("A4").putValue(200);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(60);
//Adding a sample value to "B2" cell
worksheet.getCells().get("B2").putValue(32);
//Adding a sample value to "B3" cell
worksheet.getCells().get("B3").putValue(50);
//Adding a sample value to "B4" cell
worksheet.getCells().get("B4").putValue(40);
//Adding a sample value to "C1" cell as category data
worksheet.getCells().get("C1").putValue("Q1");
//Adding a sample value to "C2" cell as category data
worksheet.getCells().get("C2").putValue("Q2");
//Adding a sample value to "C3" cell as category data
worksheet.getCells().get("C3").putValue("Y1");
//Adding a sample value to "C4" cell as category data
worksheet.getCells().get("C4").putValue("Y2");
//Adding a chart to the worksheet
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
int seriesIndex = chart.getNSeries().add("A1:B4", true);
//Setting the data source for the category data of NSeries
chart.getNSeries().setCategoryData("C1:C4");
//Filling the area of the 2nd NSeries with a gradient
chart.getNSeries().get(seriesIndex).getArea().getFillFormat().setOneColorGradient(Color.getLime(), 1, GradientStyleType.HORIZONTAL, 1);
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
getFillType()
Gets fill type
|
Color |
getGradientColor1()
Returns the gradient color 1 for the specified fill.
|
Color |
getGradientColor2()
Returns the gradient color 2 for the specified fill.
|
int |
getGradientColorType()
Returns the gradient color type for the specified fill.
|
double |
getGradientDegree()
Returns the gradient degree for the specified fill.
|
GradientFill |
getGradientFill()
Gets
getGradientFill() object. |
int |
getGradientStyle()
Returns the gradient style for the specified fill.
|
int |
getGradientVariant()
Returns the gradient variant for the specified fill.
|
byte[] |
getImageData()
Gets the picture image data.
|
int |
getPattern()
Represents an area's display pattern.
|
PatternFill |
getPatternFill()
Gets
getPatternFill() object. |
int |
getPictureFormatType()
Gets the picture format type.
|
int |
getPresetColor()
Returns the gradient preset color for the specified fill.
|
double |
getScale()
Gets the picture format scale.
|
int |
getSetType()
Deprecated.
Use FillFormat.FillType instead.
|
SolidFill |
getSolidFill()
Gets
getSolidFill() object. |
int |
getTexture()
Represents the texture type for the specified fill.
|
TextureFill |
getTextureFill()
Gets
getTextureFill() object. |
double |
getTransparency()
Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
|
int |
getType()
Deprecated.
Use FillFormat.FillType instead.
|
int |
hashCode()
Gets the hash code.
|
void |
setFillType(int value)
Sets fill type
|
void |
setImageData(byte[] value)
Sets the picture image data.
|
void |
setOneColorGradient(Color color,
double degree,
int style,
int variant)
Sets the specified fill to a one-color gradient.
|
void |
setPattern(int value)
Represents an area's display pattern.
|
void |
setPictureFormatType(int value)
Sets the picture format type.
|
void |
setPresetColorGradient(int presetColor,
int style,
int variant)
Sets the specified fill to a preset-color gradient.
|
void |
setScale(double value)
Sets the picture format scale.
|
void |
setSetType(int value)
Deprecated.
Use FillFormat.FillType instead.
|
void |
setTexture(int value)
Represents the texture type for the specified fill.
|
void |
setTransparency(double value)
Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
|
void |
setTwoColorGradient(Color color1,
Color color2,
int style,
int variant)
Sets the specified fill to a two-color gradient.
|
void |
setTwoColorGradient(Color color1,
double transparency1,
Color color2,
double transparency2,
int style,
int variant)
Sets the specified fill to a two-color gradient.
|
void |
setType(int value)
Deprecated.
Use FillFormat.FillType instead.
|
public int getType()
See FillType.
Remarks
NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.public void setType(int value)
See FillType.
Remarks
NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.public int getFillType()
See FillType.
public void setFillType(int value)
See FillType.
public double getTransparency()
public void setTransparency(double value)
public int getSetType()
See FormatSetType.
Remarks
NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.public void setSetType(int value)
See FormatSetType.
Remarks
NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.public GradientFill getGradientFill()
getGradientFill() object.public TextureFill getTextureFill()
getTextureFill() object.public SolidFill getSolidFill()
getSolidFill() object.public PatternFill getPatternFill()
getPatternFill() object.public int getGradientColorType()
See GradientColorType.
public int getGradientStyle()
See GradientStyleType.
public Color getGradientColor1()
public Color getGradientColor2()
Remarks
Only when the gradient color type is GradientColorType.TwoColors, this property is meaningful.public double getGradientDegree()
Remarks
Can only be a value from 0.0 (dark) through 1.0 (light).public int getGradientVariant()
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.public int getPresetColor()
See GradientPresetType.
public void setOneColorGradient(Color color, double degree, int style, int variant)
color - One gradient color.degree - The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).style - GradientStyleType. Gradient shading style.variant - 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.public void setTwoColorGradient(Color color1, Color color2, int style, int variant)
color1 - One gradient color.color2 - Two gradient color.style - GradientStyleType. Gradient shading style.variant - 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.public void setTwoColorGradient(Color color1, double transparency1, Color color2, double transparency2, int style, int variant)
color1 - One gradient color.transparency1 - The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).color2 - Two gradient color.transparency2 - The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).style - GradientStyleType. Gradient shading style.variant - 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.public void setPresetColorGradient(int presetColor,
int style,
int variant)
presetColor - GradientPresetType. Preset color typestyle - GradientStyleType. Gradient shading style.variant - 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.public int getTexture()
See TextureType.
public void setTexture(int value)
See TextureType.
public int getPattern()
See FillPattern.
public void setPattern(int value)
See FillPattern.
public int getPictureFormatType()
See FillPictureType.
public void setPictureFormatType(int value)
See FillPictureType.
public double getScale()
public void setScale(double value)
public byte[] getImageData()
Remarks
If the fill format is not custom texture format, returns null.public void setImageData(byte[] value)
Remarks
If the fill format is not custom texture format, returns null.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - public int hashCode()
hashCode in class java.lang.ObjectSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.