Axis Label API

Introduction
Show Axis
Show Ticker
Show Axis Arrowhead
Ticker Step Interval
Label Step Interval
Label Formats
Label Angle/Label Font
Show Label
Label Color
Axis Label Replacement
Text Replacement

Introduction
To set properties on the Axis grid, labels, range, intervals...etc, first create an IAxis object that has a handle on the chart's Axis that would be edited.  Then, the minimum, maximum, step intervals...etc can be set by using the setMinScale, setMaxScale, setScaleStep... etc.  Please refer to IAxis in the EspressChart API DOCS if additional information is desired.  Some examples are provided below.

// create an IAxis object, “hXAxis”, that has a handle on X-Axis
IAxis hXAxis = chart.gethXAxis();

// override the automatic X-Axis scale
hXAxis.setScaleAutomatic(false);

// set the new minimum to 0, maximum to 42
hXAxis.setMinScale(new Integer(0));
hXAxis.setMaxScale(new Integer(42));

// set step interval to 6
hXAxis.setScaleStep(new Integer(6));

Show Axis
For information on Show Axis, please refer to Show Axis in 2D Axis API.

Show Ticker

// show axis interval tickers
hXAxis.setTickersVisible(true);
Show Axis Arrowhead
For information on Show Axis Arrowhead, please refer to Show Axis Arrowhead in 2D Axis API.

Ticker Step Interval
To set properties on the Axis Labels such as label intervals, label numeric format...etc, first create an IDataPointSet object that has a handle on the chart's DataPoints.  Then, the properties can be edited through methods in the IDataPointSet.

// create an IDataPointSet object that has a handle on DataPoints
IDataPointSet hDataPoints = chart.gethDataPoints();

// For Ticker Step Interval example:
// set the ticker step to 6 units when category data column 3, thus index 2
hDataPoints.setTickerStep(2, 6);

Label Step Interval
// set the label step to every other ticker
hDataPoints.setLabelStep(2, 12);
Label Formats
// Setting the Date Format appearance for the chart
DateTimeFormat xAxisFormat = new DateTimeFormat();
xAxisFormat.hidedate=true;
xAxisFormat.monthSymbol=DateTimeFormat.MONTH_SHORT_STRING;
xAxisFormat.yearSymbol=DateTimeFormat.YEAR_1999;
xAxisFormat.separator2=" ";
hDataPoints.setLabelFormat(2, xAxisFormat);

// following one example in TimeInstance
// Use getTimeInstance if axis data is in Time.  Use getDateInstance if Date.
// Use getDateTimeInstance if TimeStamp.
LocaleDateTimeFormat localeDT = LocaleDateTimeFormat.getTimeInstance( java.text.DateFormat.MEDIUM, java.util.Locale.GERMANY);
// format the 3rd column of the data source
hDataPoints.setLabelFormat(2, localeDT);

// set LocaleNumericFormat to include currency symbol in Japan
LocaleNumericFormat localeNF = LocaleNumericFormat.getCurrencyInstance(java.util.Locale.JAPAN);
// format the 3rd column of the data source
hDataPoints.setLabelFormat(2, localeNF);

// Set X-Axis labels’ logical format appearance to either “T” or “F”
LogicalFormat xLogicalFormat = new LogicalFormat(LogicalFormat.T_F);
// format the 3rd column of the data source
hDataPoints.setLabelFormat(2, xLogicalFormat);

// set X-Axis value label using currency sign
NumericFormat nf = new NumericFormat();
nf.currencySymbol = '$';
// format the 3rd column of the data source which must be numeric data
hDataPoints.setLabelFormat(2, nf);

To set properties on the Axis Labels such as label font, label style, label color...etc, first create an ILabel object that has a handle on the chart's Axis.  Then, the properties can be edited through methods in the ILabel class.
// create an IAxis object that has a handle on X-Axis
IAxis hXAxis = chart.gethXAxis();

// create an ILabel object that has a handle on x-axis labels
ILabel hXLabel = hXAxis.gethLabel();

Label Angle/Label Font
// set X-Axis label font & angles
hXLabel.setFont(new Font("TIMES_ROMAN", Font.PLAIN, 12));
hXLabel.setAngle(30);  //angle in degrees counter-clockwise
Show Label
hXLabel.setVisible(true);
Label Color
// set label text to blue color
hXLabel.setColor( Color.blue);
Axis Label Replacement
// the number of string array elements must be equal to
// the number of tickers
hXAxis.setTickerLabels(new String[] {"A","","AB","Last"});
Text Replacement
// Text Replacement
hDataPoints.replace(“oldtext”, “newtext”);
Please refer to IAxis, DateTimeFormat, LocaleDateTimeFormat, LocaleNumericFormat, LogicalFormat, Numeric Format, ILabel, & IDataPointSet in EspressChart APIDocs for additional information.