All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aspose.cells.Area.html Maven / Gradle / Ivy

There is a newer version: 23.1
Show newest version





Area




com.aspose.cells
Class Area

java.lang.Object
    extended by com.aspose.cells.Area
Direct Known Subclasses:
Floor

public class Area 
extends java.lang.Object

Encapsulates the object that represents an area format.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Workbook 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 "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 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 "B3"
chart.getNSeries().add("A1:B3", true);
//Setting the foreground color of the plot area
chart.getPlotArea().getArea().setForegroundColor(Color.getBlue());
//Setting the foreground color of the chart area
chart.getChartArea().getArea().setForegroundColor(Color.getYellow());
//Setting the foreground color of the 1st NSeries area
chart.getNSeries().get(0).getArea().setForegroundColor(Color.getRed());
//Setting the foreground color of the area of the 1st NSeries point
chart.getNSeries().get(0).getPoints().get(0).getArea().setForegroundColor(Color.getCyan());


Property Getters/Setters Summary
com.aspose.cells.ColorgetBackgroundColor()
voidsetBackgroundColor(com.aspose.cells.Color)
           Gets or sets the background com.aspose.cells.Color of the Area.
FillFormatgetFillFormat()
           Represents a object that contains fill formatting properties for the specified chart or shape.
com.aspose.cells.ColorgetForegroundColor()
voidsetForegroundColor(com.aspose.cells.Color)
           Gets or sets the foreground com.aspose.cells.Color.
intgetFormatting()
voidsetFormatting(int)
           Represents the formatting of the area. The value of the property is FormattingType integer constant.
booleangetInvertIfNegative()
voidsetInvertIfNegative(boolean)
           If the property is true and the value of chart point is a negative number, the foreground color and background color will be exchanged.
doublegetTransparency()
voidsetTransparency(double)
           Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
 
Method Summary
booleanisAuto()
          
booleanisVisible()
          
voidsetAuto(boolean isAuto)
          
 

Property Getters/Setters Detail

getBackgroundColor/setBackgroundColor

public com.aspose.cells.Color getBackgroundColor() / public void setBackgroundColor(com.aspose.cells.Color value)
Gets or sets the background com.aspose.cells.Color of the Area.

setBackgroundColor

public void setBackgroundColor(com.aspose.cells.Color value)
Gets or sets the background com.aspose.cells.Color of the Area.

getForegroundColor/setForegroundColor

public com.aspose.cells.Color getForegroundColor() / public void setForegroundColor(com.aspose.cells.Color value)
Gets or sets the foreground com.aspose.cells.Color.

setForegroundColor

public void setForegroundColor(com.aspose.cells.Color value)
Gets or sets the foreground com.aspose.cells.Color.

getFormatting/setFormatting

public int getFormatting() / public void setFormatting(int value)
Represents the formatting of the area. The value of the property is FormattingType integer constant.

setFormatting

public void setFormatting(int value)
Represents the formatting of the area. The value of the property is FormattingType integer constant.

getInvertIfNegative/setInvertIfNegative

public boolean getInvertIfNegative() / public void setInvertIfNegative(boolean value)
If the property is true and the value of chart point is a negative number, the foreground color and background color will be exchanged.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Workbook 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 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 "A3"
chart.getNSeries().add("A1:A3", true);
chart.getNSeries().get(0).getArea().setInvertIfNegative(true);
//Setting the foreground color of the 1st NSeries area
chart.getNSeries().get(0).getArea().setForegroundColor(Color.getRed());
//Setting the background color of the 1st NSeries area.
//The displayed area color of second chart point will be the background color.
chart.getNSeries().get(0).getArea().setBackgroundColor(Color.getYellow());

setInvertIfNegative

public void setInvertIfNegative(boolean value)
If the property is true and the value of chart point is a negative number, the foreground color and background color will be exchanged.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Workbook 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 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 "A3"
chart.getNSeries().add("A1:A3", true);
chart.getNSeries().get(0).getArea().setInvertIfNegative(true);
//Setting the foreground color of the 1st NSeries area
chart.getNSeries().get(0).getArea().setForegroundColor(Color.getRed());
//Setting the background color of the 1st NSeries area.
//The displayed area color of second chart point will be the background color.
chart.getNSeries().get(0).getArea().setBackgroundColor(Color.getYellow());

getFillFormat

public FillFormat getFillFormat()
Represents a object that contains fill formatting properties for the specified chart or shape.
See Also:
FillFormat

getTransparency/setTransparency

public double getTransparency() / public 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).

setTransparency

public 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).

Method Detail

isAuto

public boolean isAuto()

isVisible

public boolean isVisible()

setAuto

public void setAuto(boolean isAuto)

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy