If you want to draw a vertical or horizontal line at a given position on an axis, you can use a ValueMarker :
ValueMarker marker = new ValueMarker(position); // position is the value on the axis
marker.setPaint(Color.black);
//marker.setLabel("here"); // see JavaDoc for labels, colors, strokes
XYPlot plot = (XYPlot) chart.getPlot();
plot.addDomainMarker(marker);
Use plot.addRangeMarker()
if you want to draw an horizontal line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…