2 graphs in 1 frame

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Roger Studner

2 graphs in 1 frame

Post by Roger Studner » Mon Aug 05, 2002 9:18 pm

I am trying to place two graphs inside a single frame, and have them 'share' an x-Axis. (I already know that you can't do any real 'sharing' with jFreechart, itj ust doesn't work). First, maybe it would be nice (in terms of sharing), if the Plot controlled if its axis were shown. THen I could possibly share the xAxis between two graphs, but not have to worry about xAxis.setVisible(false) making it vanish for both graphs.

Anyway, the 'real' question (above just came to mind). If I turn off my x-axis by making it not visible, and my y-axis has a 0 showning.. the 0 overlaps with the legend. It doesn't seem to leave enough space between the 2 (y-axis labels and the legend) when the x-axis is turned off.

I'm not sure the axis-insets will help, since the axis isn't being shown anyway.

Thanks,
Roger S.

Eric

Re: 2 graphs in 1 frame

Post by Eric » Tue Aug 06, 2002 5:39 pm

Roger,

It sounds like you have described a vertically combined chart that is provided by JFreeChart. Check it out.

Roger Studner

Re: 2 graphs in 1 frame

Post by Roger Studner » Wed Aug 07, 2002 6:17 pm

Well.. unless i missed something, i'm not looking to have 2 graphs 'atop' one another, but simple to place 2 or 3 distinctly different jfreecharts, that happen to share a 'common' x-axis, within 1 JFrame.

But maybe I missed something =) I look at all this too early in the morning.

Roger

Locked