5.6.6 MarkerRange

These markers draw a line of specified width on particular axis area. There are two types of MarkerRange - Horizontal and Vertical. HorizontalMarkerRange is displayed in parallels with x-axis, whilst VerticalMarkerRange is displayed in parallels with y-axis.

Setting markers:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// setting range where axisX is an instanceof Axis
VerticalMarkerRange range = new VerticalMarkerRange(axisX);
 
// setting how much area marker should take
range.setRange(2.095, 9.236);
 
// setting range outline color
range.getPaintStyle().setForeground(new Color(251, 178, 47));
 
// setting range background color
range.getPaintStyle().setBackground(Color.LIGHT_GRAY);
 
// setting range outline width  
range.getPaintStyle().setStroke(new BasicStroke(3));  
 
//setting label
range.setLabel("90%"); 
 
//setting label position
range.setLabelPosition(0.5, Alignment.CENTER, Orientation.HORIZONTAL);

MarkerRange Demonstration

Figure 5.6.6.1 MarkerRange Demonstration

View Source