По моему опыту, лучший способ добавить пользовательскую информацию в JFreeChart:
- Создание BufferedImage одного и того же типа диаграммы;
- использовать BufferedImage;
- добавить изображение к текущему графику, используя XYImageAnnotation.
Это руководство по коду:
// retrieve image type and create another BufferedImage
int imgType = chart.createBufferedImage(1,1).getType();
BufferedImage bimg = new BufferedImage(width, height, bimg.getType);
// here you can draw inside the image ( relative x & y )
Graphics2D g2 = (Graphics2D) bimg.getGraphics();
g2.drawString("Hello, JFreeChart " + timestamp, posX, posY );
// instantiate the image annotation, then add to the plot
XYImageAnnotation a = new XYImageAnnotation( x, y, bimg, RectangleAnchor.LEFT );
chart.getPlot().addAnnotation( a );