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

MethodDescription
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 in units of 1/4000 of the chart area.
getDefaultHeightRatioToChart()Represents height of default position in units of Fraction of the chart area.
getDefaultWidth()Represents width of default position in units of 1/4000 of the chart area.
getDefaultWidthRatioToChart()Represents width of default position in units of Fraction of the chart area.
getDefaultX()Represents x of default position in units of 1/4000 of the chart area.
getDefaultXRatioToChart()Represents x of default position in units of Fraction of the chart area.
getDefaultY()Represents y of default position in units of 1/4000 of the chart area.
getDefaultYRatioToChart()Represents y of default position in units of Fraction of the chart area.
getFont()Gets a getFont() object of the specified chartarea object.
getHeight()Gets the vertical offset from its lower right corner row, in units of 1/4000 of the chart area.
getHeightPixel()Gets the height of frame in units of Pixel.
getHeightRatioToChart()Gets the vertical offset from its lower right corner row, in units of ratio of the chart area.
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, in units of 1/4000 of the chart area.
getWidthPixel()Gets the width of frame in units of Pixel.
getWidthRatioToChart()Gets the horizontal offset from its lower right corner column, in units of ratio of the chart area.
getX()Gets or gets the horizontal offset from its upper left corner column, in units of 1/4000 of the chart area.
getXPixel()Gets the x coordinate of the upper left corner in units of Pixel.
getXRatioToChart()Gets or gets the horizontal offset from its upper left corner column, in units of ratio of the chart area.
getY()Gets or gets the vertical offset from its upper left corner row, in units of 1/4000 of the chart area.
getYPixel()Gets the y coordinate of the upper left corner in units of Pixel.
getYRatioToChart()Gets or gets the vertical offset from its upper left corner row, in units of ratio of the chart area.
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, in units of 1/4000 of the chart area.
setHeightPixel(int value)Sets the height of frame in units of Pixel.
setHeightRatioToChart(double value)Sets the vertical offset from its lower right corner row, in units of ratio of the chart area.
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, in units of 1/4000 of the chart area.
setWidthPixel(int value)Sets the width of frame in units of Pixel.
setWidthRatioToChart(double value)Sets the horizontal offset from its lower right corner column, in units of ratio of the chart area.
setX(int value)Gets or gets the horizontal offset from its upper left corner column, in units of 1/4000 of the chart area.
setXPixel(int value)Sets the x coordinate of the upper left corner in units of Pixel.
setXRatioToChart(double value)Gets or gets the horizontal offset from its upper left corner column, in units of ratio of the chart area.
setY(int value)Gets or gets the vertical offset from its upper left corner row, in units of 1/4000 of the chart area.
setYPixel(int value)Sets the y coordinate of the upper left corner in units of Pixel.
setYRatioToChart(double value)Gets or gets the vertical offset from its upper left corner row, in units of ratio of the chart area.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.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 in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartFrame.DefaultHeightRatioToChart property, instead. DefaultHeight = (int)(DefaultHeightRatioToChart * 4000); This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getDefaultHeightRatioToChart()

public double getDefaultHeightRatioToChart()

Represents height of default position in units of Fraction of the chart area.

Returns: double

getDefaultWidth()

public int getDefaultWidth()

Represents width of default position in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartFrame.DefaultWidthRatioToChart property, instead. DefaultWidth = (int)(DefaultWidthRatioToChart * 4000); This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getDefaultWidthRatioToChart()

public double getDefaultWidthRatioToChart()

Represents width of default position in units of Fraction of the chart area.

Returns: double

getDefaultX()

public int getDefaultX()

Represents x of default position in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartFrame.DefaultXRatioToChart property, instead. DefaultX = (int)(DefaultXRatioToChart * 4000); This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getDefaultXRatioToChart()

public double getDefaultXRatioToChart()

Represents x of default position in units of Fraction of the chart area.

Returns: double

getDefaultY()

public int getDefaultY()

Represents y of default position in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartFrame.DefaultYRatioToChart property, instead. DefaultY = (int)(DefaultYRatioToChart * 4000); This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getDefaultYRatioToChart()

public double getDefaultYRatioToChart()

Represents y of default position in units of Fraction of the chart area.

Returns: double

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, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.HeightRatioToChart property, instead. Height = HeightRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getHeightPixel()

public int getHeightPixel()

Gets the height of frame in units of Pixel.

Returns: int

getHeightRatioToChart()

public double getHeightRatioToChart()

Gets the vertical offset from its lower right corner row, in units of ratio of the chart area.

Returns: double

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, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.WidthRatioToChart property, instead. Width = WidthRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getWidthPixel()

public int getWidthPixel()

Gets the width of frame in units of Pixel.

Returns: int

getWidthRatioToChart()

public double getWidthRatioToChart()

Gets the horizontal offset from its lower right corner column, in units of ratio of the chart area.

Returns: double

getX()

public int getX()

Gets or gets the horizontal offset from its upper left corner column, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.XRatioToChart property, instead. X = XRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getXPixel()

public int getXPixel()

Gets the x coordinate of the upper left corner in units of Pixel.

Returns: int

getXRatioToChart()

public double getXRatioToChart()

Gets or gets the horizontal offset from its upper left corner column, in units of ratio of the chart area.

Returns: double

getY()

public int getY()

Gets or gets the vertical offset from its upper left corner row, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.YRatioToChart property, instead. Y = YRatioToChart * 4000; This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getYPixel()

public int getYPixel()

Gets the y coordinate of the upper left corner in units of Pixel.

Returns: int

getYRatioToChart()

public double getYRatioToChart()

Gets or gets the vertical offset from its upper left corner row, in units of ratio of the chart area.

Returns: double

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:

ParameterTypeDescription
valueboolean

setAutomaticSize(boolean value)

public void setAutomaticSize(boolean value)

Indicates whether the chart frame is automatic sized.

Parameters:

ParameterTypeDescription
valueboolean

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:

ParameterTypeDescription
valueint

setBackgroundMode(int value)

public void setBackgroundMode(int value)

Sets the display mode of the background

See BackgroundMode.

Parameters:

ParameterTypeDescription
valueint

setHeight(int value)

public void setHeight(int value)

Sets the vertical offset from its lower right corner row, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.HeightRatioToChart property, instead. Height = HeightRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setHeightPixel(int value)

public void setHeightPixel(int value)

Sets the height of frame in units of Pixel.

Parameters:

ParameterTypeDescription
valueint

setHeightRatioToChart(double value)

public void setHeightRatioToChart(double value)

Sets the vertical offset from its lower right corner row, in units of ratio of the chart area.

Parameters:

ParameterTypeDescription
valuedouble

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:

ParameterTypeDescription
valueboolean

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:

ParameterTypeDescription
valueboolean

setWidth(int value)

public void setWidth(int value)

Sets the horizontal offset from its lower right corner column, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.WidthRatioToChart property, instead. Width = WidthRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setWidthPixel(int value)

public void setWidthPixel(int value)

Sets the width of frame in units of Pixel.

Parameters:

ParameterTypeDescription
valueint

setWidthRatioToChart(double value)

public void setWidthRatioToChart(double value)

Sets the horizontal offset from its lower right corner column, in units of ratio of the chart area.

Parameters:

ParameterTypeDescription
valuedouble

setX(int value)

public void setX(int value)

Gets or gets the horizontal offset from its upper left corner column, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.XRatioToChart property, instead. X = XRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setXPixel(int value)

public void setXPixel(int value)

Sets the x coordinate of the upper left corner in units of Pixel.

Parameters:

ParameterTypeDescription
valueint

setXRatioToChart(double value)

public void setXRatioToChart(double value)

Gets or gets the horizontal offset from its upper left corner column, in units of ratio of the chart area.

Parameters:

ParameterTypeDescription
valuedouble

setY(int value)

public void setY(int value)

Gets or gets the vertical offset from its upper left corner row, in units of 1/4000 of the chart area.

Remarks

NOTE: This member is now obsolete. Please use ChartArea.YRatioToChart property, instead. Y = YRatioToChart * 4000; This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setYPixel(int value)

public void setYPixel(int value)

Sets the y coordinate of the upper left corner in units of Pixel.

Parameters:

ParameterTypeDescription
valueint

setYRatioToChart(double value)

public void setYRatioToChart(double value)

Gets or gets the vertical offset from its upper left corner row, in units of ratio of the chart area.

Parameters:

ParameterTypeDescription
valuedouble

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int