Two chart with the same size

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rupi
Posts: 8
Joined: Thu May 07, 2009 1:38 pm

Two chart with the same size

Post by rupi » Wed Jan 21, 2015 6:02 pm

I have a requirement to have two versions of the same chart stacked one above the other. I need the chart and plot sizes to be exactly the same. But I don't want the Y-Axis labels to show up on the second graph. The problem with this is that if I hide the axis label in the second chart, the plot area becomes larger. So is there a way for me to use the space for the Axis label but not display the label ?


Thanks

elmo22
Posts: 3
Joined: Fri Jan 23, 2015 10:52 pm
antibot: No, of course not.

Re: Two chart with the same size

Post by elmo22 » Fri Jan 23, 2015 11:02 pm

Here are two methods you could try:

1. Create a subclass for XYPlot and override the calculateRangeAxisSpace method or create a subclass of NumberAxis and override the reserveSpace method.

2. Change the paint for the axis, ticks, label, etc. to the background color so they are still there but not seen.

Locked