In my experience, the best way to add user information to JFreeChart is to: - create an instance of BufferedImage of the same chart type; - draw a BufferedImage; - add the image to the current chart using XYImageAnnotation.
This is the guide for the code:
int imgType = chart.createBufferedImage(1,1).getType();
BufferedImage bimg = new BufferedImage(width, height, bimg.getType);
Graphics2D g2 = (Graphics2D) bimg.getGraphics();
g2.drawString("Hello, JFreeChart " + timestamp, posX, posY );
XYImageAnnotation a = new XYImageAnnotation( x, y, bimg, RectangleAnchor.LEFT );
chart.getPlot().addAnnotation( a );
source
share