Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class PointLabelAttributes

java.lang.Object
  extended by com.softwarefx.chartfx.server.PointLabelAttributes

public class PointLabelAttributes
extends Object

Provides access to the PointAttributes object, which allows you to configure how the labeling is rendered by the chart.

Unless defined otherwise, all the point labels of the chart share the same settings. Those global settings are available through the PointAttributes.getPointLabels() property of the GlobalAttributes. The GlobalAttributes Class is accessible through the Chart.getAllSeries() property of the chart.


Constructor Summary
PointLabelAttributes()
           
 
Method Summary
 StringAlignment getAlignment()
          Gets the Alignment.
 short getAngle()
          Gets the Angle.
 Color getBackColor()
          Gets the BackColor.
 Color getBorderColor()
          Gets the BorderColor.
 short getBorderWidth()
          Gets the BorderWidth.
 Font getFont()
          Gets the Font.
 String getFormat()
          Gets the Format.
 StringAlignment getLineAlignment()
          Gets the LineAlignment.
 Point getOffset()
          Gets the Offset.
 Color getTextColor()
          Gets the TextColor.
 boolean isRichText()
          Gets the RichText.
 boolean isVisible()
          Gets the Visible.
 void setAlignment(StringAlignment value)
          Sets the vertical alignment for the point label.
 void setAngle(short value)
          Sets the angle of the point label.
 void setBackColor(Color value)
          Sets the backgrond color of the point label.
 void setBorderColor(Color value)
          Sets the border color of the point label.
 void setBorderWidth(short value)
          Sets a value indicating the width of the border surrounding the point label.
 void setFont(Font value)
          Sets a Font object to use as rendering font for the point label.
 void setFormat(String value)
          Sets a string pattern mask used to format the label.
 void setLineAlignment(StringAlignment value)
          Sets the horizontal alignment for the point label.
 void setOffset(Point value)
          Allows you to customize the point label position by configuring its coordinates.
 void setRichText(boolean value)
          Sets or Gets a value indicating the Text will be treated as RichText
 void setTextColor(Color value)
          Sets a value for the point label color.
 void setVisible(boolean value)
          Sets a value indicating if point label should be displayed or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointLabelAttributes

public PointLabelAttributes()
Method Detail

getAlignment

public StringAlignment getAlignment()

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


getAngle

public short getAngle()

Gets the Angle. For more detail see setAngle(short).


getBackColor

public Color getBackColor()

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


getBorderColor

public Color getBorderColor()

Gets the BorderColor. For more detail see setBorderColor(java.awt.Color).


getBorderWidth

public short getBorderWidth()

Gets the BorderWidth. For more detail see setBorderWidth(short).


getFont

public Font getFont()

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


getFormat

public String getFormat()

Gets the Format. For more detail see setFormat(java.lang.String).


getLineAlignment

public StringAlignment getLineAlignment()

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


getOffset

public Point getOffset()

Gets the Offset. For more detail see setOffset(java.awt.Point).


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).


isVisible

public boolean isVisible()

Gets the Visible. For more detail see setVisible(boolean).


setAlignment

public void setAlignment(StringAlignment value)

Sets the vertical alignment for the point label.

Remarks:
  • For more information on StringAlignment see the Java API documentation.

  • The possible values are Center, Far, Near.

  • Bellow, the alignment of the point labels is set to near:

  • See Also:
    setAngle(short), setFont(java.awt.Font), setFormat(java.lang.String), setOffset(java.awt.Point), setLineAlignment(com.softwarefx.StringAlignment), PointAttributes, SeriesAttributes, GlobalAttributes

    setAngle

    public void setAngle(short value)

    Sets the angle of the point label.

    Remarks:
  • The default rotation angle is 0 degree (i.e., horizontal). Use a positive number to rotate the labels from lower left to upper right. Use negative degrees to rotate text from upper left to lower right.

  • When generating charts using Java API , the angles "0" and "90" are the only supported configurations.

  • In order to set this property, the font type associated with the axis needs to be a True Type Font.

  • This property is also available in the SeriesAttributes or PointAttributes objects. Therefore, a label angle can be set to a specific series or point instead of Chart.getAllSeries()in the chart.

  • To use this property, you must make sure the PointAttributes.getPointLabels()are setVisible(boolean).

  • Bellow, the angle of the point labels is set to 45:

  • See Also:
    setFont(java.awt.Font), PointAttributes.getPointLabels(), SeriesAttributes, PointAttributes, GlobalAttributes

    setBackColor

    public void setBackColor(Color value)

    Sets the backgrond color of the point label.

    Remarks:
  • The PointAttributes.getPointLabels() property of the PointAttributes Class returns a PointLabelsAttributes object.

  • The setBorderColor(java.awt.Color) property gets or sets the border color of the point label.

  • The setBorderWidth(short) property gets or sets a value indicating the width of the border surrounding the point label.

  • The setVisible(boolean) property is a boolean indicating if point label should be displayed or not.

  • For more information regarding the Color type, please refer to your Java API documentation.

  • Named color are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").

  • Bellow, the Back color of the point labels is set to red:

  • See Also:
    setBorderColor(java.awt.Color), setBorderWidth(short), SeriesAttributes, PointAttributes, GlobalAttributes

    setBorderColor

    public void setBorderColor(Color value)

    Sets the border color of the point label.

    Remarks:
  • The PointAttributes.getPointLabels() property of the PointAttributes Class returns a PointLabelsAttributes object.

  • The setBackColor(java.awt.Color) property gets or sets the backgrond color of the point label.

  • The setBorderWidth(short) property gets or sets a value indicating the width of the border surrounding the point label.

  • The setAlignment(com.softwarefx.StringAlignment) property is used to control the vertical alignment for the point label.

  • The setVisible(boolean) property is a boolean indicating if point label should be displayed or not.

  • Named color are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").

  • For more information regarding the Color type, please refer to your Java API documentation.

  • See Also:
    setBackColor(java.awt.Color), setBorderWidth(short), setAlignment(com.softwarefx.StringAlignment), SeriesAttributes, PointAttributes, GlobalAttributes

    setBorderWidth

    public void setBorderWidth(short value)

    Sets a value indicating the width of the border surrounding the point label.

    Remarks:
  • The PointAttributes.getPointLabels() property of the PointAttributes Class returns a PointLabelsAttributes object.

  • The setBorderColor(java.awt.Color) property gets or sets the border color of the point label.

  • The setBackColor(java.awt.Color) property gets or sets the background color of the point label.

  • See Also:
    setBorderColor(java.awt.Color), SeriesAttributes, PointAttributes, GlobalAttributes

    setFont

    public void setFont(Font value)

    Sets a Font object to use as rendering font for the point label.

    Remarks:
  • When setting a font, you must create a new font object with the desired attributes and assign that object to the desired chart element every time.

  • See the Font Class in Java API

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

  • Bellow, the font of the point labels is set to Arial 12:

  • See Also:
    Chart.setFont(java.awt.Font), setFormat(java.lang.String), SeriesAttributes, PointAttributes, GlobalAttributes

    setFormat

    public void setFormat(String value)

    Sets a string pattern mask used to format the label.

    Remarks:
  • Variables can be accessed using the % following the variable you want to include:

    l Shows X-Axis Legend.

    k Shows X-Axis Key Legend.

    s Shows Series Legend.

    S Shows the Series Index.

    x Shows XValue (XY charts, when they were set with X values).

    i Shows IniValues (Gantt).

    v Shows Data Value.

    v <n> For types that require more than one series, these are replaced by the value of each one. (n represents an index).

    t Series Total (Sum of all points in this series).

    p Percentage of total this point represents (Pie).

    T Point Total (Sum of all series for this point).

    P Percentage of total this series represents (Used in stacked charts).

    X displays the marker X value for any chart type including those that do not support X values such as bar.

    N Shows the index for the point.

    L Shows the PointAttributes.setText(java.lang.String) property of the PointAttributes object.

  • See Also:
    Chart.setToolTipFormat(java.lang.String), Chart.expandMacros(java.lang.String, int, int, boolean), SeriesAttributes, PointAttributes, GlobalAttributes

    setLineAlignment

    public void setLineAlignment(StringAlignment value)

    Sets the horizontal alignment for the point label.

    Remarks:
  • For more information on StringAlignment see the Java API documentation.

  • The possible values are Center, Far, Near.

  • Bellow, the line alignment of the point labels is set to far:

  • See Also:
    setAngle(short), setFont(java.awt.Font), setFormat(java.lang.String), setOffset(java.awt.Point), setAlignment(com.softwarefx.StringAlignment), PointAttributes, SeriesAttributes, GlobalAttributes

    setOffset

    public void setOffset(Point value)

    Allows you to customize the point label position by configuring its coordinates.

    Remarks:
  • X represents the offset in pixel of the label related to the X Axis. Y represents the offset in pixel of the label related to the Y Axis. X and Y can be either positive or negative.

  • X represents the offset in pixel of the label related to the Chart.getAxisX(). Y represents the offset in pixel of the label related to the Chart.getAxisY(). X and Y can be either positive or negative.

  • You may configure a Java API point object with the desired values and assign that object to the PointLabelOffset property.

  • Bellow, the offset property of the point labels is set to 4 pixels up and 5 pixels to the right:

  • See Also:
    PointAttributes, SeriesAttributes, GlobalAttributes

    setRichText

    public void setRichText(boolean value)

    Sets or Gets a value indicating the Text will be treated as RichText

    Remarks:
  • The PointAttributes.getPointLabels() property of the PointAttributes Class returns a PointLabelsAttributes object.

  • The setTextColor(java.awt.Color) property is used to get or set a value for the point label color.

  • The setVisible(boolean) property is a boolean indicating if point label should be displayed or not.

  • Bellow, the point labels use the RichText property to set the word "Point" to bold and underline

  • See Also:
    PointAttributes.setText(java.lang.String), setTextColor(java.awt.Color), PointAttributes, SeriesAttributes, GlobalAttributes

    setTextColor

    public void setTextColor(Color value)

    Sets a value for the point label color.

    Remarks:
  • It is recommended to use a light color when the Chart.setPlotAreaBackground(com.softwarefx.chartfx.server.adornments.IBackgroundAdornment) of the chart is dark (and, vice versa).

  • See Color Class in Java API

  • Named color are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").

  • Bellow, the text color of the point labels is set to red:

  • See Also:
    setFont(java.awt.Font), setBackColor(java.awt.Color), setBorderColor(java.awt.Color), PointAttributes, SeriesAttributes, GlobalAttributes

    setVisible

    public void setVisible(boolean value)

    Sets a value indicating if point label should be displayed or not.

    Remarks:
  • The PointAttributes.getPointLabels() property of the PointAttributes Class returns a PointLabelsAttributes object.

  • The setAlignment(com.softwarefx.StringAlignment) property is used to control the vertical alignment for the point label.

  • The setBackColor(java.awt.Color) property gets or sets the background color of the point label.

  • The setBorderColor(java.awt.Color) property gets or sets the border color of the point label.

  • The setBorderWidth(short) property gets or sets a value indicating the width of the border surrounding the point label.

  • See Also:
    setAngle(short), setAlignment(com.softwarefx.StringAlignment), PointAttributes, SeriesAttributes, GlobalAttributes

    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.