Question

I am using a ChartPanel from JFreeChart (1.0.14) to display some plots. The Layout is handled by MigLayout and all works well. However, I have strange behaviour from time to time. The minimal size of the panel changes sometimes when the plots change. I am not setting it in my code but leave everything to MigLayout.

Unfortunately I am unable to reproduce this behaviour in an SSCCE, especially the first S. But in my application it also occurs when I am just changing the renderer to display a thicker line for one of the XYSeries.

So my question:

  • Is it possible that the layout parameters are changed within the code of JFreeChart depending on the displayed content?
  • If so, is it possible to turn off this behaviour? Because I don't want anything else than MigLayout to lay hands on the layout parameters...
Was it helpful?

Solution

Ok, I figured out the problem. My ChartPanel is in a TabbedPane with other tabs. One of those other tabs also contains charts. And one of those charts has a logarithmic range axis. Now I put in data that contained negative values, which can not be displayed logarithmically and the reaction of the axis was to just zoom out in both directions as much as possible. This resulted in extremly long axis labels (0.0000000[..]00001 and 10000[..]0000). This resulted in MigLayout giving more space to this panel and recursively also demanding more space from the tabbed pane. So the tabbed pane grew also for my other tabs.

Quiet strange and hard to figure out... ;) Thanks to trashgod for your willingness to help. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top