5.6.7 BoxMarker

BoxMarker marker is similar to MarkerRange marker, however, there are more options, where to place marker and it does not contain text. This marker might be used, when there is a need to stress some part of chart.

Setting BoxMarker:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//sets BoxMarker object named boxmarker, for xAxis and yAxis axes,
// which are instances of Axis
BoxMarker boxmarker = new BoxMarker(xAxis, yAxis);
 
// setting colors for marker
boxmarker.getPaintStyle().setBackground(Color.red);
boxmarker.getPaintStyle().setForeground(Color.darkGray);
boxmarker.getPaintStyle().setTransparencyValue(120);
 
// setting area where marker should stand
boxmarker.setBounds(170, -3, 870, 0);
 
// .....
 
// adding marker to chart
chart.setObjects(new ChartObject[] { grid, lineSeries,boxmarker });

BoxMarker Demonstration

Figure 5.6.7.1 BoxMarker Demonstration

View Source