ChartArea
Inheritance: java.lang.Object, com.aspose.cells.ChartFrame
public class ChartArea extends ChartFrame
Encapsulates the object that represents the chart area in the worksheet.
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
//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);
//Getting Chart Area
ChartArea chartArea = chart.getChartArea();
//Setting the foreground color of the chart area
chartArea.getArea().setForegroundColor(Color.getYellow());
//Setting Chart Area Shadow
chartArea.setShadow(true);
//Saving the Excel file
workbook.save("book1.xls");
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getArea() | Gets the Area. |
getAutoScaleFont() | True if the text in the object changes font size when the object size changes. |
getBackground() | Gets the display mode of the background |
getBackgroundMode() | Gets the display mode of the background |
getBorder() | Gets the Line. |
getChart() | Gets the chart to which this object belongs. |
getClass() | |
getDefaultHeight() | Represents height of default position |
getDefaultWidth() | Represents width of default position |
getDefaultX() | Represents x of default position |
getDefaultY() | Represents y of default position |
getFont() | Gets a getFont() object of the specified chartarea object. |
getHeight() | Gets the vertical offset from its lower right corner row. |
getShadow() | True if the frame has a shadow. |
getShapeProperties() | Gets the getShapeProperties() object. |
getTextFont() | Gets a ChartArea.getFont() object of the specified ChartFrame object. |
getTextOptions() | Gets the options of the text. |
getWidth() | Gets the horizontal offset from its lower right corner column. |
getX() | Gets or gets the horizontal offset from its upper left corner column. |
getY() | Gets or gets the vertical offset from its upper left corner row. |
hashCode() | |
isAutomaticSize() | Indicates whether the chart frame is automatic sized. |
isDefaultPosBeSet() | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. |
isInnerMode() | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. |
notify() | |
notifyAll() | |
setAutoScaleFont(boolean value) | True if the text in the object changes font size when the object size changes. |
setAutomaticSize(boolean value) | Indicates whether the chart frame is automatic sized. |
setBackground(int value) | Sets the display mode of the background |
setBackgroundMode(int value) | Sets the display mode of the background |
setHeight(int value) | Sets the vertical offset from its lower right corner row. |
setInnerMode(boolean value) | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. |
setPositionAuto() | Set position of the frame to automatic |
setShadow(boolean value) | True if the frame has a shadow. |
setWidth(int value) | Sets the horizontal offset from its lower right corner column. |
setX(int value) | Gets or gets the horizontal offset from its upper left corner column. |
setY(int value) | Gets or gets the vertical offset from its upper left corner row. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getArea()
public Area getArea()
Gets the Area.
Returns: Area
getAutoScaleFont()
public boolean getAutoScaleFont()
True if the text in the object changes font size when the object size changes. The default value is True.
Returns: boolean
getBackground()
public int getBackground()
Gets the display mode of the background
See BackgroundMode.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Returns: int
getBackgroundMode()
public int getBackgroundMode()
Gets the display mode of the background
See BackgroundMode.
Returns: int
getBorder()
public Line getBorder()
Gets the Line.
Returns: Line
getChart()
public Chart getChart()
Gets the chart to which this object belongs.
Returns: Chart
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getDefaultHeight()
public int getDefaultHeight()
Represents height of default position
Returns: int
getDefaultWidth()
public int getDefaultWidth()
Represents width of default position
Returns: int
getDefaultX()
public int getDefaultX()
Represents x of default position
Returns: int
getDefaultY()
public int getDefaultY()
Represents y of default position
Returns: int
getFont()
public Font getFont()
Gets a getFont() object of the specified chartarea object.
Returns: Font
getHeight()
public int getHeight()
Gets the vertical offset from its lower right corner row.
Returns: int
getShadow()
public boolean getShadow()
True if the frame has a shadow.
Returns: boolean
getShapeProperties()
public ShapePropertyCollection getShapeProperties()
Gets the getShapeProperties() object.
Returns: ShapePropertyCollection
getTextFont()
public Font getTextFont()
Gets a ChartArea.getFont() object of the specified ChartFrame object.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.Font property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Returns: Font
getTextOptions()
public TextOptions getTextOptions()
Gets the options of the text.
Returns: TextOptions
getWidth()
public int getWidth()
Gets the horizontal offset from its lower right corner column.
Returns: int
getX()
public int getX()
Gets or gets the horizontal offset from its upper left corner column.
Returns: int
getY()
public int getY()
Gets or gets the vertical offset from its upper left corner row.
Returns: int
hashCode()
public native int hashCode()
Returns: int
isAutomaticSize()
public boolean isAutomaticSize()
Indicates whether the chart frame is automatic sized.
Returns: boolean
isDefaultPosBeSet()
public boolean isDefaultPosBeSet()
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
Returns: boolean
isInnerMode()
public boolean isInnerMode()
Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.
Remarks
Only for Xlsx file.
Returns: boolean
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setAutoScaleFont(boolean value)
public void setAutoScaleFont(boolean value)
True if the text in the object changes font size when the object size changes. The default value is True.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setAutomaticSize(boolean value)
public void setAutomaticSize(boolean value)
Indicates whether the chart frame is automatic sized.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setBackground(int value)
public void setBackground(int value)
Sets the display mode of the background
See BackgroundMode.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setBackgroundMode(int value)
public void setBackgroundMode(int value)
Sets the display mode of the background
See BackgroundMode.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setHeight(int value)
public void setHeight(int value)
Sets the vertical offset from its lower right corner row.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setInnerMode(boolean value)
public void setInnerMode(boolean value)
Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.
Remarks
Only for Xlsx file.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setPositionAuto()
public void setPositionAuto()
Set position of the frame to automatic
setShadow(boolean value)
public void setShadow(boolean value)
True if the frame has a shadow.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setWidth(int value)
public void setWidth(int value)
Sets the horizontal offset from its lower right corner column.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setX(int value)
public void setX(int value)
Gets or gets the horizontal offset from its upper left corner column.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setY(int value)
public void setY(int value)
Gets or gets the vertical offset from its upper left corner row.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |