Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class Title

java.lang.Object
  extended by com.softwarefx.chartfx.server.Title
Direct Known Subclasses:
TitleDockable

public class Title
extends Object

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

Title

public Title()
Method Detail

getAlignment

public StringAlignment getAlignment()

Gets the Alignment. For more detail see setAlignment(com.softwarefx.StringAlignment).


getBackColor

public Color getBackColor()

Gets the BackColor. For more detail see setBackColor(java.awt.Color).


getFont

public Font getFont()

Gets the Font. For more detail see setFont(java.awt.Font).


getIndentation

public int getIndentation()

Gets the Indentation. For more detail see setIndentation(int).


getLineAlignment

public StringAlignment getLineAlignment()

Gets the LineAlignment. For more detail see setLineAlignment(com.softwarefx.StringAlignment).


getLink

public Link getLink()

Gets the Link object for a selected title item.

Remarks:
  • 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.

  • See Also:
    Link.setUrl(java.lang.String), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Link, Chart

    getSeparation

    public int getSeparation()

    Gets the Separation. For more detail see setSeparation(int).


    getText

    public String getText()

    Gets the Text. For more detail see setText(java.lang.String).


    getTextColor

    public Color getTextColor()

    Gets the TextColor. For more detail see setTextColor(java.awt.Color).


    isRichText

    public boolean isRichText()

    Gets the RichText. For more detail see setRichText(boolean).


    setAlignment

    public void setAlignment(StringAlignment value)

    Allows you to set the alignment of the specified title.

    Remarks:
  • 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):

  • See Also:
    setLineAlignment(com.softwarefx.StringAlignment), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Axis, Chart, TitleDockable

    setBackColor

    public void setBackColor(Color value)

    Sets the background color of the specified title.

    Remarks:
  • 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:

  • See Also:
    setTextColor(java.awt.Color), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Axis, Chart

    setFont

    public void setFont(Font value)

    Assigns a font to the specified title.

    Remarks:
  • 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:

  • See Also:
    setText(java.lang.String), Chart.setFont(java.awt.Font), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Chart, Axis

    setIndentation

    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.

    Remarks:
  • 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:

  • See Also:
    Chart.getPlotAreaMargin(), setSeparation(int), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Axis, Chart, Margins

    setLineAlignment

    public void setLineAlignment(StringAlignment value)

    Sets the vertical alignment for the lines of the chart title.

    Remarks:
  • 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.

  • See Also:
    setAlignment(com.softwarefx.StringAlignment), Chart.getTitles(), Axis, Chart

    setRichText

    public void setRichText(boolean value)

    Sets the RichText property for the selected Title.

    Remarks:
  • 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:

  • See Also:
    setText(java.lang.String), setFont(java.awt.Font), setTextColor(java.awt.Color), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Chart, Axis

    setSeparation

    public void setSeparation(int value)

    Specifies the space in pixels above and below the selected title text when read from right to left.

    Remarks:
  • 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:

  • See Also:
    setIndentation(int), setText(java.lang.String), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Axis, Chart

    setText

    public void setText(String value)

    Sets the text for the selected title.

    Remarks:
  • 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.

  • See Also:
    setTextColor(java.awt.Color), setBackColor(java.awt.Color), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), setRichText(boolean), Chart, Axis

    setTextColor

    public void setTextColor(Color value)

    Sets the color of text for the specified title.

    Remarks:
  • 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:

  • See Also:
    Chart.getAxisX(), setBackColor(java.awt.Color), Axis.setTitle(com.softwarefx.chartfx.server.Title), Chart.getTitles(), Axis, Chart

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.