|
Chart FX 7 for Java Server | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softwarefx.chartfx.server.Title
public class Title
Provides access to the Title object, and allows the customization of the axis titles as well as the titles of the chart.
A title is a string that can be assigned to any portion outside the main chart area.
Chart FX for Java
supports the creation of many titles through the Chart.getTitles()
property in the Chart
Class
.
Axis.setTitle(com.softwarefx.chartfx.server.Title)
are also available for AxisX
and AxisY
.
Titles can be positioned, aligned and formatted according to the different properties supported by this
Class
and the TitleDockable
Class
.
Titles can be assigned via the Chart FX for Java designer properties list or you can create and control them programmatically.
Constructor Summary | |
---|---|
Title()
|
Method Summary | |
---|---|
StringAlignment |
getAlignment()
Gets the Alignment. |
Color |
getBackColor()
Gets the BackColor. |
Font |
getFont()
Gets the Font. |
int |
getIndentation()
Gets the Indentation. |
StringAlignment |
getLineAlignment()
Gets the LineAlignment. |
Link |
getLink()
Gets the Link object for a selected title item. |
int |
getSeparation()
Gets the Separation. |
String |
getText()
Gets the Text. |
Color |
getTextColor()
Gets the TextColor. |
boolean |
isRichText()
Gets the RichText. |
void |
setAlignment(StringAlignment value)
Allows you to set the alignment of the specified title. |
void |
setBackColor(Color value)
Sets the background color of the specified title. |
void |
setFont(Font value)
Assigns a font to the specified title. |
void |
setIndentation(int value)
Specifies the space in pixels to the front and back of the selected title when read from top to bottom. |
void |
setLineAlignment(StringAlignment value)
Sets the vertical alignment for the lines of the chart title. |
void |
setRichText(boolean value)
Sets the RichText property for the selected Title. |
void |
setSeparation(int value)
Specifies the space in pixels above and below the selected title text when read from right to left. |
void |
setText(String value)
Sets the text for the selected title. |
void |
setTextColor(Color value)
Sets the color of text for the specified title. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Title()
Method Detail |
---|
public StringAlignment getAlignment()
Gets the Alignment. For more detail see setAlignment(com.softwarefx.StringAlignment)
.
public Color getBackColor()
Gets the BackColor. For more detail see setBackColor(java.awt.Color)
.
public Font getFont()
Gets the Font. For more detail see setFont(java.awt.Font)
.
public int getIndentation()
Gets the Indentation. For more detail see setIndentation(int)
.
public StringAlignment getLineAlignment()
Gets the LineAlignment. For more detail see setLineAlignment(com.softwarefx.StringAlignment)
.
public Link getLink()
Gets the Link object for a selected title item.
Developers may obtain the Link object for a title item using this property. Using the supported Link
Class
members, developers may configure a Link.setUrl(java.lang.String)
and Target for the object.
Link.setUrl(java.lang.String)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Link
,
Chart
public int getSeparation()
Gets the Separation. For more detail see setSeparation(int)
.
public String getText()
Gets the Text. For more detail see setText(java.lang.String)
.
public Color getTextColor()
Gets the TextColor. For more detail see setTextColor(java.awt.Color)
.
public boolean isRichText()
Gets the RichText. For more detail see setRichText(boolean)
.
public void setAlignment(StringAlignment value)
Allows you to set the alignment of the specified title.
The alignment of a specified title may be assigned to Near, Center or Far using this property. Reading the chart from left to right, Near will be to the left and Far will be to the right. For information regarding the StringAlignment type refer to Java API .
The Alignment property may also be used for Axis Axis.setTitle(com.softwarefx.chartfx.server.Title)
by utilizing the Axis
Class
.
The setLineAlignment(com.softwarefx.StringAlignment)
property can be used to position the top title vertically in the title area.
Below, the alignment of the X axis is set to Far (i.e., right aligned):
Similarly, the alignment of the X axis is set to Center:
Finally, the alignment is set to Near (i.e., left aligned):
setLineAlignment(com.softwarefx.StringAlignment)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Axis
,
Chart
,
TitleDockable
public void setBackColor(Color value)
Sets the background color of the specified title.
This property gives the title of a chart a highlighted effect. It is best to select colors that contrast to the setTextColor(java.awt.Color)
in order to view the titles clearly.
See Java API documentation for information regarding the Color type.
Named colors are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").
Below, the background title of the chart is set to yellow:
setTextColor(java.awt.Color)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Axis
,
Chart
public void setFont(Font value)
Assigns a font to the specified title.
You can set the font for the entire chart using the Chart
object Chart.setFont(java.awt.Font)
property.
When setting a font in Chart FX for Java , you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.
For more information regarding the Font type, please refer to the Java API Documentation.
Fonts can be specified by using the standard string notation for fully or partially qualifying a font object. For example, "Verdana,12,style=italic,Bold" produces a font of type Verdana, point size of 12 and font style of Italic and Bold.
Below, the title of the chart is rendered using an Arial font of size 12:
setText(java.lang.String)
,
Chart.setFont(java.awt.Font)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Chart
,
Axis
public void setIndentation(int value)
Specifies the space in pixels to the front and back of the selected title when read from top to bottom.
This property assigns space in pixels around a Title string in reference to the title orientation. If the Title text reads vertically (Y Axis title, or a TitleDockable
docked to the right or left), the space will be assigned above and below the string.
The setSeparation(int)
property may be used to add space in pixels above and below the title string when read from right to left.
Below, the Indentation property for the title of the Y axis is set to 50:
Alternatively, the Indentation property here is set to 100:
Chart.getPlotAreaMargin()
,
setSeparation(int)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Axis
,
Chart
,
Margins
public void setLineAlignment(StringAlignment value)
Sets the vertical alignment for the lines of the chart title.
By changing the LineAlignment value, you can control the distance from the title to the chart.
The setAlignment(com.softwarefx.StringAlignment)
property allows you set the title left, center or right justified in the chart.
setAlignment(com.softwarefx.StringAlignment)
,
Chart.getTitles()
,
Axis
,
Chart
public void setRichText(boolean value)
Sets the RichText property for the selected Title.
When this property is set to true, the Title setText(java.lang.String)
can be enhanced by adding basic HTML markup.
The available markup tags are:
Bold: <b>text</b>
Underline: <u>text</u>
Italic: <i>text</i>
Strike:<s>text</s>
Font: <font color="#FF0000" face="Arial">text</font>
All markup tags must be closed.
<font> has two attributes: color, to set the color in html format (i.e. #00FF66), and face, to set the font name.
Below, the chart uses a title with the word "Sales" bold and underlined:
setText(java.lang.String)
,
setFont(java.awt.Font)
,
setTextColor(java.awt.Color)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Chart
,
Axis
public void setSeparation(int value)
Specifies the space in pixels above and below the selected title text when read from right to left.
This property assigns space in pixels around a Title string in reference to the title orientation. If the Title text reads horizontally (top title), space will be assigned above and below the string.
The setIndentation(int)
property may be used to add space in pixels to the front and back of the title string when read from right to left.
Below, the Separation property for the title of the X axis is set to 20:
Alternatively, the Separation property here is set to 50:
setIndentation(int)
,
setText(java.lang.String)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Axis
,
Chart
public void setText(String value)
Sets the text for the selected title.
The setTextColor(java.awt.Color)
property allows you to change the color of the specified title text.
Text can be enhanced by setting the setRichText(boolean)
property true. Bold, Italic, Underline, Font Face and Color can be set by adding basic HTML markup to the text.
setTextColor(java.awt.Color)
,
setBackColor(java.awt.Color)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
setRichText(boolean)
,
Chart
,
Axis
public void setTextColor(Color value)
Sets the color of text for the specified title.
The TextColor property is used in conjunction with the setText(java.lang.String)
property.
For more information regarding the Color type, please refer to the Java API Documentation.
Named colors are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").
Below, the title of the chart is set to 'My Title' and TextColor is set to red:
Chart.getAxisX()
,
setBackColor(java.awt.Color)
,
Axis.setTitle(com.softwarefx.chartfx.server.Title)
,
Chart.getTitles()
,
Axis
,
Chart
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |