5.8.1 Axis

AxisPaintTags

These tags can be used for setting colors of axis. It can be done for either the whole axis (AXIS) or only some parts of it (TICKS, LABEL and etc.).

Possible tags and their meaning.

Tag Explanation
AxisPaintTags.DEFAULT Style for painting axis line
AxisPaintTags.AXISStyle for painting axis line
AxisPaintTags.TICKS Style for painting axis ticks
AxisPaintTags.LABEL Style for painting axis labels
AxisPaintTags.SHADOW Style for painting axis shadow
AxisPaintTags.ZOOM_WHITE_INVERT Style for inverted zoom painting
AxisPaintTags.ARROW Style for arrow

Table 5.8.1.1 AxisPaintTags

Usage:

1
2
3
4
5
6
7
8
//setting axis line color
axisY.getPaintStyle().setForeground(AxisPaintTags.AXIS, new Color(49,139,31));
//setting axis line color
axisX.getPaintStyle().setForeground(AxisPaintTags.AXIS, new Color(49,139,31));
//setting axis label background color using AxisPaintTags
axisY.getPaintStyle().setBackground(AxisPaintTags.LABEL, new Color(251, 178, 47,120));
// setting shadow
axisY.getPaintStyle().setBackground(AxisPaintTags.SHADOW, Color.gray.brighter());

AxisPaintTags demonstration

Figure 5.8.1.1 AxisPaintTags demonstration

View Source

AxisTextPaintTags

These tags can be used for setting colors of axis text elements.

Tag Explanation
AxisTextPaintTags.LABELStyle for setting labels color
AxisTextPaintTags.TITLE Style for setting title color
AxisTextPaintTags.KEY_LABEL Style for setting key labels font

Table 5.8.1.2 AxisTextPaintTags

Usage:

 
axisX.getTextStyle().setFont(AxisTextPaintTags.LABEL, new Font("dialog", Font.PLAIN, 16));

AxisNumberFormat

These tags is used for setting LogAxisMapper number format.

Tag Explanation
AxisNumberFormat.EXPONENTIAL Exponential format (for example 1.0E2 and so on)
AxisNumberFormat.DECIMAL Decimal format (for example 1000.0 and so on)

Table 5.8.1.3 AxisNumberFormats

Usage:

AxisNumberFormat.DECIMAL
 
LogAxisMapper m = new LogAxisMapper(10,500);
m.setNumberFormat(AxisNumberFormat.DECIMAL);
AxisNumberFormat.EXPONENTIAL
 
LogAxisMapper m = new LogAxisMapper(1,50);
m.setNumberFormat(AxisNumberFormat.EXPONENTIAL);