afreechart/src/main/java/org/afree/ui/RefineryUtilities.java
/**
     * Draws a string that is aligned by one anchor point and rotated about
     * another anchor point.
     * 
     * @param text
     *            the text.
     * @param canvas
     *            the graphics device.
     * @param x
     *            the location of the text anchor.
     * @param y
     *            the location of the text anchor.
     * @param textAnchor
     *            the text anchor.
     * @param rotateX
     *            the x-coordinate for the rotation anchor point.
     * @param rotateY
     *            the y-coordinate for the rotation anchor point.
     * @param angle
     *            the rotation angle.
     */
Draws a string that is aligned by one anchor point and rotated about
another anchor point.

@param text
the text.
@param canvas
the graphics device.
@param x
the location of the text anchor.
@param y
the location of the text anchor.
@param textAnchor
the text anchor.
@param rotateX
the x-coordinate for the rotation anchor point.
@param rotateY
the y-coordinate for the rotation anchor point.
@param angle
the rotation angle.
Draws a string that is aligned by one anchor point and rotated about another anchor point . @param text the text . @param canvas the graphics device . @param x the location of the text anchor . @param y the location of the text anchor . @param textAnchor the text anchor . @param rotateX the x - coordinate for the rotation anchor point . @param rotateY the y - coordinate for the rotation anchor point . @param angle the rotation angle .
public static void drawRotatedString(final String text, final Canvas canvas,
            final float x, final float y, final TextAnchor textAnchor,
            final float rotateX, final float rotateY,
            final Paint paint, float angle) {
        final float[] textAdj = deriveTextBoundsAnchorOffsets(paint, text, textAnchor);
        canvas.save();
        if (angle == 0.0)
            canvas.drawText(text, x + textAdj[0], y + textAdj[1], paint);
        else {
            canvas.rotate((float) Math.toDegrees(angle), rotateX, rotateY);
            canvas.drawText(text, x + textAdj[0], y + textAdj[1], paint);
        }
        canvas.restore();
    }
public static void drawRotatedString ( final String text , final Canvas canvas , final float x , final float y , final TextAnchor textAnchor , final float rotateX , final float rotateY , final Paint paint , float angle ) { final float [ ] textAdj = deriveTextBoundsAnchorOffsets ( paint , text , textAnchor ) ; canvas . save ( ) ; if ( angle == 0.0 ) canvas . drawText ( text , x + textAdj [ 0 ] , y + textAdj [ 1 ] , paint ) ; else { canvas . rotate ( ( float ) Math . toDegrees ( angle ) , rotateX , rotateY ) ; canvas . drawText ( text , x + textAdj [ 0 ] , y + textAdj [ 1 ] , paint ) ; } canvas . restore ( ) ; }
Draws a string that is aligned by one anchor point and rotated about
 another anchor point.
Draws a string that is aligned by one anchor point and rotated about another anchor point .
//canvas.drawCircle(x + textAdj[0], y + textAdj[1], 2, paint);