This part of the API is rather low-level, and mostly used internally by JFreechart. For example, GridArrangement
may be used to create a particular legend layout, within a chart.
In my opinion, the easiest way to create a grid of charts, is to use a Swing JPanel
and a GridLayout
, and fill that grid with your charts.
JPanel grid = new JPanel( new GridLayout(m,n) );
for(int i=0; i<m*n; i++)
grid.add(new ChartPanel(createChart(i)));
You can also use a CombinedPlot
. This allows to add as many plots as you want, either layed out side-by-side, or stacked vertically (but not on a grid, as far as I know). The good thing with this approach is that your plots will directly share a common axis, and will be aligned nicely. (But that depends on your problem: do your charts share one common axis ? Perhaps two ?)