JFreeChart: how do you put multiple charts in a composite chart?

JFreeChart has a concept of a composite diagram.

I need to lay out several diagrams in a grid similar to the layout.

Each chart in the grid should have its own separate title.

I would like to save this composite diagram in a png file

I would get a piece of code that explains how to do this.

+5
source share
1 answer

As shown here , ChartPanelyou can put it into any desired Swing layout. In the above example is used GridLayout. ChartUtilitieshas methods for rendering charts like .png. I see several approaches to obtaining a composite image:

  • Robot#createScreenCapture() , ; BufferedImage ImageIO.write().

  • JFreeChart#createBufferedImage() BufferedImage , .

  • Printable , .

image

+6

All Articles