textAnchor = TextAnchor.TOP_LEFT;
else if ("TOP_RIGHT".equals(str))
textAnchor = TextAnchor.TOP_RIGHT;
}
Plot plot = ((JFreeChart) chart).getPlot();
if (plot instanceof XYPlot) {
XYTextAnnotation anno = drawArrow
? new XYPointerAnnotation(text, x, y, arrowAngle)
: new XYTextAnnotation(text, x, y);
anno.setPaint(textPaint);