Grid charts

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
karolinas
Posts: 5
Joined: Fri Mar 25, 2016 3:32 pm
antibot: No, of course not.

Grid charts

Post by karolinas » Thu Sep 01, 2016 2:26 pm

I was wondering, whether there is now a functionality allowing to plot multiple charts in a grid? So that when right-clicked on the chart it would give the options for the whole grid, rather than a single chart and would save that grid to png, pdf and svg? :shock:

karolinas
Posts: 5
Joined: Fri Mar 25, 2016 3:32 pm
antibot: No, of course not.

Re: Grid charts

Post by karolinas » Mon Sep 12, 2016 12:07 pm

Okay, so following a similar procedure to MultiplePiePlot I created a grid of XY charts. However, I am now having an issue with the legend, I'd like adding one legend only at the bottom of the grid, but if I try including a legend it includes one at the bottom of each chart in the grid. Is there a way to create one legend and draw it separately from the whole plot?

Also, is there a way to find the height and width of the actual chart without tick marks and labels? As I want to only display tick marks and units at the first column for the range axis and the last row for the domain axis. However, if I do that, the size of the actual rectangle of the chart for the first column and last row is smaller than the other.

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Grid charts

Post by paradoxoff » Wed Sep 14, 2016 10:37 am

karolinas wrote:Okay, so following a similar procedure to MultiplePiePlot I created a grid of XY charts. However, I am now having an issue with the legend, I'd like adding one legend only at the bottom of the grid, but if I try including a legend it includes one at the bottom of each chart in the grid. Is there a way to create one legend and draw it separately from the whole plot?
There is most certainly a way to achieve that, but the implementation will depend on how you have implemented your grid chart. You could remove the legends from the "child charts" in the grid and add a legend to the "parent chart".
karolinas wrote: Also, is there a way to find the height and width of the actual chart without tick marks and labels? As I want to only display tick marks and units at the first column for the range axis and the last row for the domain axis. However, if I do that, the size of the actual rectangle of the chart for the first column and last row is smaller than the other.
After the rendering: yes. The desired values should be the width and height of the data area. You can get the data area by quering the ChartRenderingIno (chartRenderingInfo.getPlotInfo().getDataArea()).
Before the rendering: no, since this value isn't existing. A JFreeChart is drawn from the outside in, using the Rectangle2D provided as parameter to the draw-method of a JFreeChart as starting point. This rectangle is getting continuously smaller as titles, insets and axes are drawn. Whatever remains left is used as data area.
Several years ago, I have put together a patch that allows to specifiy some of the area sizes, but I never managed to provide tha patch in a sufficiently clean way to get it integrated into the official release.

Locked