Title

Inheritance: java.lang.Object, com.aspose.cells.ChartFrame, com.aspose.cells.ChartTextFrame

public class Title extends ChartTextFrame

Encapsulates the object that represents the title of chart or axis.

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");

Methods

MethodDescription
characters()Gets rich text formatting of this Title.
characters(int startIndex, int length)Returns a Characters object that represents a range of characters within the text.
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.
getCharacters()Gets rich text formatting of this Title.
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
getDirectionType()Gets the direction of text.
getFont()Gets a ChartArea.getFont() object of the specified ChartFrame object.
getHeight()Gets the height of frame in units of 1/4000 of the chart area.
getLinkedSource()Gets a reference to the worksheet.
getOverLay()Represents overlay centered title on chart without resizing chart.
getReadingOrder()Represents text reading order.
getRotationAngle()Represents text rotation angle.
getShadow()True if the frame has a shadow.
getShapeProperties()Gets the getShapeProperties() object.
getText()Gets the text of display unit label.
getTextDirection()Represents text reading order.
getTextFont()Gets a ChartArea.getFont() object of the specified ChartFrame object.
getTextHorizontalAlignment()Gets the text horizontal alignment.
getTextOptions()Gets the options of the text.
getTextVerticalAlignment()Gets the text vertical alignment of text.
getWidth()Gets the width of frame in units of 1/4000 of the chart area.
getX()Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
getY()Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
hashCode()
isAutoText()Indicates the text is auto generated.
isAutomaticRotation()Indicates whether the text of the chart is automatically rotated.
isAutomaticSize()Indicates whether the chart frame is automatic sized.
isDefaultPosBeSet()Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
isDeleted()Indicates whether this data labels is deleted.
isInnerMode()Indicates whether the size of the plot area size includes the tick marks, and the axis labels.
isResizeShapeToFitText()Gets whether a shape should be auto-fit to fully contain the text described within it.
isTextWrapped()Gets a value indicating whether the text is wrapped.
isVisible()Represents whether the title is visible.
notify()
notifyAll()
setAutoScaleFont(boolean value)True if the text in the object changes font size when the object size changes.
setAutoText(boolean value)Indicates the text is auto generated.
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
setDeleted(boolean value)Indicates whether this data labels is deleted.
setDirectionType(int value)Sets the direction of text.
setHeight(int value)Sets the height of frame in units of 1/4000 of the chart area.
setInnerMode(boolean value)Indicates whether the size of the plot area size includes the tick marks, and the axis labels.
setLinkedSource(String value)Sets a reference to the worksheet.
setOverLay(boolean value)Represents overlay centered title on chart without resizing chart.
setPositionAuto()Set position of the frame to automatic
setReadingOrder(int value)Represents text reading order.
setResizeShapeToFitText(boolean value)Sets whether a shape should be auto-fit to fully contain the text described within it.
setRotationAngle(int value)Represents text rotation angle.
setShadow(boolean value)True if the frame has a shadow.
setText(String value)Sets the text of display unit label.
setTextDirection(int value)Represents text reading order.
setTextHorizontalAlignment(int value)Sets the text horizontal alignment.
setTextVerticalAlignment(int value)Sets the text vertical alignment of text.
setTextWrapped(boolean value)Sets a value indicating whether the text is wrapped.
setVisible(boolean value)Represents whether the title is visible.
setWidth(int value)Sets the width of frame in units of 1/4000 of the chart area.
setX(int value)Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
setY(int value)Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

characters()

public FontSetting[] characters()

Gets rich text formatting of this Title.

Returns: com.aspose.cells.FontSetting[] - returns FontSetting array

characters(int startIndex, int length)

public FontSetting characters(int startIndex, int length)

Returns a Characters object that represents a range of characters within the text.

Parameters:

ParameterTypeDescription
startIndexintThe index of the start of the character.
lengthintThe number of characters.

Returns: FontSetting - Characters object.

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

getCharacters()

public FontSetting[] getCharacters()

Gets rich text formatting of this Title.

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.

Returns: com.aspose.cells.FontSetting[] - returns FontSetting array

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

getDirectionType()

public int getDirectionType()

Gets the direction of text.

See ChartTextDirectionType.

Returns: int

getFont()

public Font getFont()

Gets a ChartArea.getFont() object of the specified ChartFrame object.

Returns: Font

getHeight()

public int getHeight()

Gets the height of frame in units of 1/4000 of the chart area.

Remarks

How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;

Returns: int

getLinkedSource()

public String getLinkedSource()

Gets a reference to the worksheet.

Returns: java.lang.String

getOverLay()

public boolean getOverLay()

Represents overlay centered title on chart without resizing chart.

Returns: boolean

getReadingOrder()

public int getReadingOrder()

Represents text reading order.

See TextDirectionType.

Returns: int

getRotationAngle()

public int getRotationAngle()

Represents text rotation angle.

Remarks

0: Not rotated.

255: Top to Bottom.

-90: Downward.

90: Upward.

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

getText()

public String getText()

Gets the text of display unit label.

Returns: java.lang.String

getTextDirection()

public int getTextDirection()

Represents text reading order.

See TextDirectionType.

Remarks

NOTE: This member is now obsolete. Instead, please use ChartTextFrame.ReadingOrder property. This property will be removed 12 months later since March 2020. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

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

getTextHorizontalAlignment()

public int getTextHorizontalAlignment()

Gets the text horizontal alignment.

See TextAlignmentType.

Returns: int

getTextOptions()

public TextOptions getTextOptions()

Gets the options of the text.

Returns: TextOptions

getTextVerticalAlignment()

public int getTextVerticalAlignment()

Gets the text vertical alignment of text.

See TextAlignmentType.

Returns: int

getWidth()

public int getWidth()

Gets the width of frame in units of 1/4000 of the chart area.

Remarks

How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;

Returns: int

getX()

public int getX()

Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area.

Returns: int

getY()

public int getY()

Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Returns: int

hashCode()

public native int hashCode()

Returns: int

isAutoText()

public boolean isAutoText()

Indicates the text is auto generated.

Returns: boolean

isAutomaticRotation()

public boolean isAutomaticRotation()

Indicates whether the text of the chart is automatically rotated.

Returns: boolean

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

isDeleted()

public boolean isDeleted()

Indicates whether this data labels is deleted.

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

isResizeShapeToFitText()

public boolean isResizeShapeToFitText()

Gets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside.

Returns: boolean

isTextWrapped()

public boolean isTextWrapped()

Gets a value indicating whether the text is wrapped.

Returns: boolean

isVisible()

public boolean isVisible()

Represents whether the title is visible.

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

setAutoText(boolean value)

public void setAutoText(boolean value)

Indicates the text is auto generated.

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

setDeleted(boolean value)

public void setDeleted(boolean value)

Indicates whether this data labels is deleted.

Parameters:

ParameterTypeDescription
valueboolean

setDirectionType(int value)

public void setDirectionType(int value)

Sets the direction of text.

See ChartTextDirectionType.

Parameters:

ParameterTypeDescription
valueint

setHeight(int value)

public void setHeight(int value)

Sets the height of frame in units of 1/4000 of the chart area.

Remarks

How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;

Parameters:

ParameterTypeDescription
valueint

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

setLinkedSource(String value)

public void setLinkedSource(String value)

Sets a reference to the worksheet.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setOverLay(boolean value)

public void setOverLay(boolean value)

Represents overlay centered title on chart without resizing chart.

Parameters:

ParameterTypeDescription
valueboolean

setPositionAuto()

public void setPositionAuto()

Set position of the frame to automatic

setReadingOrder(int value)

public void setReadingOrder(int value)

Represents text reading order.

See TextDirectionType.

Parameters:

ParameterTypeDescription
valueint

setResizeShapeToFitText(boolean value)

public void setResizeShapeToFitText(boolean value)

Sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside.

Parameters:

ParameterTypeDescription
valueboolean

setRotationAngle(int value)

public void setRotationAngle(int value)

Represents text rotation angle.

Remarks

0: Not rotated.

255: Top to Bottom.

-90: Downward.

90: Upward.

Parameters:

ParameterTypeDescription
valueint

setShadow(boolean value)

public void setShadow(boolean value)

True if the frame has a shadow.

Parameters:

ParameterTypeDescription
valueboolean

setText(String value)

public void setText(String value)

Sets the text of display unit label.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setTextDirection(int value)

public void setTextDirection(int value)

Represents text reading order.

See TextDirectionType.

Remarks

NOTE: This member is now obsolete. Instead, please use ChartTextFrame.ReadingOrder property. This property will be removed 12 months later since March 2020. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setTextHorizontalAlignment(int value)

public void setTextHorizontalAlignment(int value)

Sets the text horizontal alignment.

See TextAlignmentType.

Parameters:

ParameterTypeDescription
valueint

setTextVerticalAlignment(int value)

public void setTextVerticalAlignment(int value)

Sets the text vertical alignment of text.

See TextAlignmentType.

Parameters:

ParameterTypeDescription
valueint

setTextWrapped(boolean value)

public void setTextWrapped(boolean value)

Sets a value indicating whether the text is wrapped.

Parameters:

ParameterTypeDescription
valueboolean

setVisible(boolean value)

public void setVisible(boolean value)

Represents whether the title is visible.

Parameters:

ParameterTypeDescription
valueboolean

setWidth(int value)

public void setWidth(int value)

Sets the width of frame in units of 1/4000 of the chart area.

Remarks

How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;

Parameters:

ParameterTypeDescription
valueint

setX(int value)

public void setX(int value)

Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.

Parameters:

ParameterTypeDescription
valueint

setY(int value)

public void setY(int value)

Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Parameters:

ParameterTypeDescription
valueint

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