|
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.PointLabelAttributes
public class PointLabelAttributes
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 |
---|
public PointLabelAttributes()
Method Detail |
---|
public StringAlignment getAlignment()
Gets the Alignment. For more detail see setAlignment(com.softwarefx.StringAlignment)
.
public short getAngle()
Gets the Angle. For more detail see setAngle(short)
.
public Color getBackColor()
Gets the BackColor. For more detail see setBackColor(java.awt.Color)
.
public Color getBorderColor()
Gets the BorderColor. For more detail see setBorderColor(java.awt.Color)
.
public short getBorderWidth()
Gets the BorderWidth. For more detail see setBorderWidth(short)
.
public Font getFont()
Gets the Font. For more detail see setFont(java.awt.Font)
.
public String getFormat()
Gets the Format. For more detail see setFormat(java.lang.String)
.
public StringAlignment getLineAlignment()
Gets the LineAlignment. For more detail see setLineAlignment(com.softwarefx.StringAlignment)
.
public Point getOffset()
Gets the Offset. For more detail see setOffset(java.awt.Point)
.
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 boolean isVisible()
Gets the Visible. For more detail see setVisible(boolean)
.
public void setAlignment(StringAlignment value)
Sets the vertical alignment for the point label.
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:
setAngle(short)
,
setFont(java.awt.Font)
,
setFormat(java.lang.String)
,
setOffset(java.awt.Point)
,
setLineAlignment(com.softwarefx.StringAlignment)
,
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
public void setAngle(short value)
Sets the angle of the point label.
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:
setFont(java.awt.Font)
,
PointAttributes.getPointLabels()
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setBackColor(Color value)
Sets the backgrond color of the point label.
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:
setBorderColor(java.awt.Color)
,
setBorderWidth(short)
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setBorderColor(Color value)
Sets the border color of the point label.
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.
setBackColor(java.awt.Color)
,
setBorderWidth(short)
,
setAlignment(com.softwarefx.StringAlignment)
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setBorderWidth(short value)
Sets a value indicating the width of the border surrounding the point label.
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.
setBorderColor(java.awt.Color)
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setFont(Font value)
Sets a Font object to use as rendering font for the point label.
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:
Chart.setFont(java.awt.Font)
,
setFormat(java.lang.String)
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setFormat(String value)
Sets a string pattern mask used to format the label.
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.
Chart.setToolTipFormat(java.lang.String)
,
Chart.expandMacros(java.lang.String, int, int, boolean)
,
SeriesAttributes
,
PointAttributes
,
GlobalAttributes
public void setLineAlignment(StringAlignment value)
Sets the horizontal alignment for the point label.
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:
setAngle(short)
,
setFont(java.awt.Font)
,
setFormat(java.lang.String)
,
setOffset(java.awt.Point)
,
setAlignment(com.softwarefx.StringAlignment)
,
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
public void setOffset(Point value)
Allows you to customize the point label position by configuring its coordinates.
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:
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
public void setRichText(boolean value)
Sets or Gets a value indicating the Text will be treated as RichText
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
PointAttributes.setText(java.lang.String)
,
setTextColor(java.awt.Color)
,
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
public void setTextColor(Color value)
Sets a value for the point label color.
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:
setFont(java.awt.Font)
,
setBackColor(java.awt.Color)
,
setBorderColor(java.awt.Color)
,
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
public void setVisible(boolean value)
Sets a value indicating if point label should be displayed or not.
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.
setAngle(short)
,
setAlignment(com.softwarefx.StringAlignment)
,
PointAttributes
,
SeriesAttributes
,
GlobalAttributes
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |