public class Title extends ChartTextFrame
Example
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.get(0,1).putValue("Income");
cells.get(1,0).putValue("Company A");
cells.get(2,0).putValue("Company B");
cells.get(3,0).putValue("Company C");
cells.get(1,1).putValue(10000);
cells.get(2,1).putValue(20000);
cells.get(3,1).putValue(30000);
int chartIndex = sheet.getCharts().add(ChartType.COLUMN, 9, 9, 21, 15);
Chart chart = sheet.getCharts().get(chartIndex);
//Setting the title of a chart
chart.getTitle().setText("Title");
//Setting the font color of the chart title to blue
chart.getTitle().getFont().setColor(Color.getBlue());
//Setting the title of category axis of the chart
chart.getCategoryAxis().getTitle().setText("Category");
//Setting the title of value axis of the chart
chart.getValueAxis().getTitle().setText("Value");
| Modifier and Type | Method and Description |
|---|---|
FontSetting[] |
characters()
Gets rich text formatting of this Title.
|
FontSetting[] |
getCharacters()
Deprecated.
Use Title.Characters() method instead.
|
boolean |
getOverLay()
Represents overlay centered title on chart without resizing chart.
|
java.lang.String |
getText()
Gets the text of display unit label.
|
int |
getX()
Deprecated.
Use Title.XRatioToChart property, instead.
|
double |
getXRatioToChart()
Gets the x coordinate of the upper left corner in units of Fraction of the chart area.
|
int |
getY()
Deprecated.
Use Title.YRatioToChart property, instead.
|
double |
getYRatioToChart()
Gets the y coordinate of the upper left corner in units of Fraction of the chart area.
|
boolean |
isVisible()
Represents whether the title is visible.
|
void |
setOverLay(boolean value)
Represents overlay centered title on chart without resizing chart.
|
void |
setText(java.lang.String value)
Sets the text of display unit label.
|
void |
setVisible(boolean value)
Represents whether the title is visible.
|
void |
setX(int value)
Deprecated.
Use Title.XRatioToChart property, instead.
|
void |
setXRatioToChart(double value)
Sets the x coordinate of the upper left corner in units of Fraction of the chart area.
|
void |
setY(int value)
Deprecated.
Use Title.YRatioToChart property, instead.
|
void |
setYRatioToChart(double value)
Sets the y coordinate of the upper left corner in units of Fraction of the chart area.
|
characters, getDirectionType, getLinkedSource, getReadingOrder, getRotationAngle, getTextDirection, getTextHorizontalAlignment, getTextVerticalAlignment, isAutomaticRotation, isAutoText, isDeleted, isResizeShapeToFitText, isTextWrapped, setAutoText, setDeleted, setDirectionType, setLinkedSource, setReadingOrder, setResizeShapeToFitText, setRotationAngle, setTextDirection, setTextHorizontalAlignment, setTextVerticalAlignment, setTextWrappedgetArea, getAutoScaleFont, getBackground, getBackgroundMode, getBorder, getChart, getDefaultHeight, getDefaultHeightRatioToChart, getDefaultWidth, getDefaultWidthRatioToChart, getDefaultX, getDefaultXRatioToChart, getDefaultY, getDefaultYRatioToChart, getFont, getHeight, getHeightPixel, getHeightRatioToChart, getShadow, getShapeProperties, getTextFont, getTextOptions, getWidth, getWidthPixel, getWidthRatioToChart, getXPixel, getYPixel, isAutomaticSize, isDefaultPosBeSet, isInnerMode, setAutomaticSize, setAutoScaleFont, setBackground, setBackgroundMode, setHeight, setHeightPixel, setHeightRatioToChart, setInnerMode, setPositionAuto, setShadow, setWidth, setWidthPixel, setWidthRatioToChart, setXPixel, setYPixelpublic java.lang.String getText()
getText in class ChartTextFramepublic void setText(java.lang.String value)
setText in class ChartTextFramepublic boolean isVisible()
public void setVisible(boolean value)
public int getX()
Remarks
NOTE: This member is now obsolete. Please use Title.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.getX in class ChartFramepublic void setX(int value)
Remarks
NOTE: This member is now obsolete. Please use Title.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.setX in class ChartFramepublic int getY()
Remarks
NOTE: This member is now obsolete. Please use Title.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.getY in class ChartFramepublic void setY(int value)
Remarks
NOTE: This member is now obsolete. Please use Title.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.setY in class ChartFramepublic double getXRatioToChart()
getXRatioToChart in class ChartFramepublic void setXRatioToChart(double value)
setXRatioToChart in class ChartFramepublic double getYRatioToChart()
getYRatioToChart in class ChartFramepublic void setYRatioToChart(double value)
setYRatioToChart in class ChartFramepublic boolean getOverLay()
public void setOverLay(boolean value)
public FontSetting[] getCharacters()
Remarks
NOTE: This member is now obsolete. Instead, please use Title.Characters() method. This property will be removed 12 months later since November 2016. Aspose apologizes for any inconvenience you may have experienced.public FontSetting[] characters()
See 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.