com.steema.teechart.axis
Class AxisLabels

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.Shape
          extended by com.steema.teechart.TextShape
              extended by com.steema.teechart.axis.AxisLabels

public class AxisLabels
extends TextShape

Axis Label characteristic

Title: AxisLabels class

Description: Axis Label characteristics

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Field Summary
protected  Axis axis
           
protected  java.lang.String axisvaluesformat
           
protected  boolean bExponent
           
protected  boolean bOnAxis
           
protected  int iAngle
           
protected  int iSeparation
           
 AxisLabelStyle iStyle
           
protected  int position
           
protected  java.lang.String sDatetimeformat
           
protected  MessageFormat valuesDecimal
           
 
Fields inherited from class com.steema.teechart.TextShape
defaultText, drawText
 
Fields inherited from class com.steema.teechart.Shape
bBevel, bBorderRound, bBrush, bImageBevel, bTransparent, defaultVisible, pPen, shadow, shapeBounds, visible
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
AxisLabels(Axis a)
          Accesses the Label characteristics of Axis Labels.
 
Method Summary
static java.lang.String formatNumber(double number, int decimals, java.lang.String digitGrouping)
           
 AxisLabelAlign getAlign()
          The position of Labels on an Axis.
 boolean getAlternate()
          Gets the axis labels to be drawn in two rows or columns.
 int getAngle()
          Defines the rotation degree applied to each Axis Label.
 int getCustomSize()
          Changes the spacing occupied by the axis labels between the Ticks and the Title.
 java.lang.String getDateTimeFormat()
          Standard DateTime formatting string specifier used to draw the axis labels.
 boolean getExactDateTime()
          Determines whether Axis.Increment calculates Axis Labels in exact DateTime steps.
 boolean getExponent()
          Enables/disables the display of Axis Labels in exponent format with super-script fonts.
 AxisLabelsItems getItems()
          Contains the custom labels.
 boolean getMultiLine()
          Automatically breaks DateTime Labels on occurence of a space " ".
 boolean getOnAxis()
          Determines whether the Labels at Axis Minimum and Maximum positions will be shown or not.
 int getPosition()
           
 boolean getRoundFirstLabel()
          Controls if Axis labels will be automatically "rounded" to the nearest magnitude.
 int getSeparation()
          Specifies the minimum distance between Axis Labels as a percentage.
 AxisLabelStyle getStyle()
          The style of the labels.
 java.lang.String getValueFormat()
          Specifies the desired formatting string to be applied to Axis Labels.
 int labelHeight(double value)
          returns the Axis Label height of the Value parameter.
 java.lang.String labelValue(double value)
          returns the corresponding text representation of the Value parameter.
 int labelWidth(double value)
          returns the Axis Label width of the Value parameter.
protected  java.lang.Object readResolve()
           
 void setAlign(AxisLabelAlign value)
          Sets the position of Labels on an Axis.
 void setAlternate(boolean value)
          Sets the axis labels to be drawn in two rows or columns.
 void setAngle(int value)
          Defines the rotation degree applied to each Axis Label.
 void setCustomSize(int value)
          Changes the spacing occupied by the axis labels between the Ticks and the Title.
 void setDateTimeFormat(java.lang.String value)
          Standard DateTime formatting string specifier used to draw the axis labels.
 void setExactDateTime(boolean value)
          Determines whether Axis.Increment calculates Axis Labels in exact DateTime steps.
 void setExponent(boolean value)
          Enables/disables the display of Axis Labels in exponent format with super-script fonts.
 void setMultiLine(boolean value)
          Automatically breaks DateTime Labels on occurence of a space " ".
 void setOnAxis(boolean value)
          Shows the Labels at Axis Minimum and Maximum positions when true.
 void setRoundFirstLabel(boolean value)
          Axis labels will be automatically "rounded" to the nearest magnitude when true.
 void setSeparation(int value)
          Specifies the minimum distance between Axis Labels as a percentage.
 void setStyle(AxisLabelStyle value)
          Sets the style of the labels.
 void setValueFormat(java.lang.String value)
          Specifies the desired formatting string to be applied to Axis Labels.
protected  boolean shouldSerializeTransparent()
           
 java.lang.String splitInLines(java.lang.String s, char separator)
          Sets Separator Char to invoke 'new line' in String St.
 java.lang.String splitInLines(java.lang.String s, java.lang.String separator)
          Sets Separator String to invoke 'new line' in String St.
 
Methods inherited from class com.steema.teechart.TextShape
assign, drawRectRotated, drawString, drawText, getAutoSize, getFont, getLines, getLinesLength, getShadowSize, getShapeStyle, getText, getTextFormat, paint, paint, paint, setAutoSize, setChart, setDrawText, setLines, setShadowSize, setShapeStyle, setText, setTextFormat
 
Methods inherited from class com.steema.teechart.Shape
assign, getBevel, getBevelInner, getBevelOuter, getBevelWidth, getBorderRound, getBottom, getBrush, getColor, getGradient, getHeight, getImage, getImageBevel, getImageMode, getImageTransparent, getLeft, getPen, getRight, getShadow, getShapeBounds, getTop, getTransparency, getTransparent, getVisible, getWidth, setBevel, setBevelInner, setBevelOuter, setBevelWidth, setBorderRound, setBottom, setBrush, setColor, setDefaultVisible, setHeight, setImage, setImageMode, setImageTransparent, setLeft, setPen, setRight, setShapeBounds, setTop, setTransparency, setTransparent, setVisible, setWidth
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iAngle

protected int iAngle

bOnAxis

protected boolean bOnAxis

iSeparation

protected int iSeparation

iStyle

public AxisLabelStyle iStyle

bExponent

protected boolean bExponent

position

protected int position

axisvaluesformat

protected java.lang.String axisvaluesformat

valuesDecimal

protected transient MessageFormat valuesDecimal

sDatetimeformat

protected java.lang.String sDatetimeformat

axis

protected transient Axis axis
Constructor Detail

AxisLabels

public AxisLabels(Axis a)
Accesses the Label characteristics of Axis Labels.

Parameters:
a - Axis
Method Detail

readResolve

protected java.lang.Object readResolve()
Overrides:
readResolve in class TextShape

shouldSerializeTransparent

protected boolean shouldSerializeTransparent()

getExactDateTime

public boolean getExactDateTime()
Determines whether Axis.Increment calculates Axis Labels in exact DateTime steps.
This is very useful when Axis.Increment is a DateTimeStep constant value.
When ExactDateTime is false (the default value), the OneMonth increment equals 30 days, and axis do not calculate how many days a month has.
The Series XValues or YValues properties should have DateTime = true. ( XValues for horizontal Axis and YValues for vertical Axis). Default value: false

Returns:
boolean

setExactDateTime

public void setExactDateTime(boolean value)
Determines whether Axis.Increment calculates Axis Labels in exact DateTime steps.
Default value: false

Parameters:
value - boolean

getAngle

public int getAngle()
Defines the rotation degree applied to each Axis Label. Valid angle in degrees are 0, 90, 180, 270 and 360.
Please note that some printers and video drivers fail when drawing rotated fonts or calculating the rotated font dimensions. Metafile Charts containing rotated fonts sometimes place text at sligthly different coordinates. Default value: 0

Returns:
int

setAngle

public void setAngle(int value)
Defines the rotation degree applied to each Axis Label.
Default value: 0

Parameters:
value - int

getOnAxis

public boolean getOnAxis()
Determines whether the Labels at Axis Minimum and Maximum positions will be shown or not.
Default value: true

Returns:
boolean

setOnAxis

public void setOnAxis(boolean value)
Shows the Labels at Axis Minimum and Maximum positions when true.
Default value: true

Parameters:
value - boolean

getSeparation

public int getSeparation()
Specifies the minimum distance between Axis Labels as a percentage. Setting it to "0" zero makes Axis skip calculating overlapping labels. (No clipping is performed). Labels visibility depends also on Labels.Font size, Labels.Angle and Axis.Increment properties.
Default value: 10

Returns:
int

setSeparation

public void setSeparation(int value)
Specifies the minimum distance between Axis Labels as a percentage.
Default value: 10

Parameters:
value - int

getCustomSize

public int getCustomSize()
Changes the spacing occupied by the axis labels between the Ticks and the Title.
Default value: 0

Returns:
int

setCustomSize

public void setCustomSize(int value)
Changes the spacing occupied by the axis labels between the Ticks and the Title.
Default value: 0

Parameters:
value - int

getStyle

public AxisLabelStyle getStyle()
The style of the labels. Setting Axis.Label.Style to talAuto will force the Axis to guess what labels will be drawn. For each Active associated Series, if the Series have XLabels then the Label.Style will be talText. If no Series have XLabels, then Label.Style will be talValue. If no Active Series are associated with the Axis, then Label.Style will be talNone.
Default value: AxisLabelStyle.Auto

Returns:
AxisLabelStyle

setStyle

public void setStyle(AxisLabelStyle value)
Sets the style of the labels.
Default value: AxisLabelStyle.Auto

Parameters:
value - AxisLabelStyle

getRoundFirstLabel

public boolean getRoundFirstLabel()
Controls if Axis labels will be automatically "rounded" to the nearest magnitude. Run-time only. This applies both to DateTime and non-DateTime axis values. When false, Axis labels will start at Maximum Axis value.
Default value: true

Returns:
boolean

setRoundFirstLabel

public void setRoundFirstLabel(boolean value)
Axis labels will be automatically "rounded" to the nearest magnitude when true.
Default value: true

Parameters:
value - boolean

getDateTimeFormat

public java.lang.String getDateTimeFormat()
Standard DateTime formatting string specifier used to draw the axis labels.
Default value: ""

Returns:
String

setDateTimeFormat

public void setDateTimeFormat(java.lang.String value)
Standard DateTime formatting string specifier used to draw the axis labels.
Default value: ""

Parameters:
value - String

getValueFormat

public java.lang.String getValueFormat()
Specifies the desired formatting string to be applied to Axis Labels. It has effect when Axis associated Series have their XValues.DateTime or YValues.DateTime property set to false.
For DateTime Axis labels use the AxisLabels.DateTimeFormat property.
ValueFormat is a standard formatting string specifier. Chart Axis uses it to draw the axis labels. Chart Series uses it to draw the Marks.
Default value: '#,##0.###'

Returns:
formatting String to be applied to Axis Labels.

setValueFormat

public void setValueFormat(java.lang.String value)
Specifies the desired formatting string to be applied to Axis Labels.
Default value: '#,##0.###'

Parameters:
value - String

getMultiLine

public boolean getMultiLine()
Automatically breaks DateTime Labels on occurence of a space " ". Use '\n' in other label types to break a line or use SplitInLines in the OnGetAxisLabel event.
Default value: false

Returns:
boolean

setMultiLine

public void setMultiLine(boolean value)
Automatically breaks DateTime Labels on occurence of a space " ".
Default value: false

Parameters:
value - boolean

splitInLines

public java.lang.String splitInLines(java.lang.String s,
                                     java.lang.String separator)
Sets Separator String to invoke 'new line' in String St. Replaces input string St with separator to be used to break lines at each occurrence of the separator.

Parameters:
s - Input String
separator - String to be used for new line
Returns:
String

splitInLines

public java.lang.String splitInLines(java.lang.String s,
                                     char separator)
Sets Separator Char to invoke 'new line' in String St. Replaces input string St with separator to be used to break lines at each occurrence of the separator.

Parameters:
s - Input String
separator - char to be used for new line
Returns:
String

getExponent

public boolean getExponent()
Enables/disables the display of Axis Labels in exponent format with super-script fonts.
Default value: false

Returns:
boolean

setExponent

public void setExponent(boolean value)
Enables/disables the display of Axis Labels in exponent format with super-script fonts.
Default value: false

Parameters:
value - boolean

getAlign

public AxisLabelAlign getAlign()
The position of Labels on an Axis.
The default position of an AxisLabel will depend on the Axis with which it is associated. A Bottom Axis will place Labels below the Axis by default. A Top Axis will place the Labels above the Axis.
Default value: Default position
Opposite: Labels positioned on the opposite side to the default position.

Returns:
AxisLabelAlign

setAlign

public void setAlign(AxisLabelAlign value)
Sets the position of Labels on an Axis.
Default value: Default position

Parameters:
value - AxisLabelAlign

getItems

public AxisLabelsItems getItems()
Contains the custom labels.

Returns:
AxisLabelsItems

labelWidth

public int labelWidth(double value)
returns the Axis Label width of the Value parameter. It uses the Axis formatting specifiers, the Axis Labels Font and the Labels rotation and style.

Parameters:
value - double Axis value
Returns:
int Axis Label width in pixels

labelHeight

public int labelHeight(double value)
returns the Axis Label height of the Value parameter. It uses the Axis formatting specifiers, the Axis Labels Font and the Labels rotation and style.

Parameters:
value - double Axis value
Returns:
int Axis Label height in pixels

formatNumber

public static java.lang.String formatNumber(double number,
                                            int decimals,
                                            java.lang.String digitGrouping)

labelValue

public java.lang.String labelValue(double value)
returns the corresponding text representation of the Value parameter. It uses the Axis formatting specifiers.

Parameters:
value - double
Returns:
String

getAlternate

public boolean getAlternate()
Gets the axis labels to be drawn in two rows or columns.

Returns:
boolean

setAlternate

public void setAlternate(boolean value)
Sets the axis labels to be drawn in two rows or columns.

Parameters:
value - boolean

getPosition

public int getPosition()