Marker rangeMarkerCutoff= new ValueMarker(cutoff);
rangeMarkerCutoff.setPaint(Color.white);
rangeMarkerCutoff.setLabelFont(helveticaBold18);
String markerCutoffString=benchmarkLabel+" "+cutoff.intValue()+"%";
markerCutoffString=wrapMarkerLabel(markerCutoffString);
rangeMarkerCutoff.setLabel(markerCutoffString);
rangeMarkerCutoff.setLabelOffset(new RectangleInsets(1,35,20,85));
rangeMarkerCutoff.setLabelBackgroundColor(Color.white);
rangeMarkerCutoff.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
plot.addRangeMarker(rangeMarkerCutoff);
这里必须包装 markerCutoffString 我已经使用了这样的函数 wrapMarkerLabel ,但没有用
private static final String wrapMarkerLabel(String label) {
String wrappedlabel = WordUtils.wrap(label,-100);
return wrappedlabel;
}