Hello,
I have a simple XYPlot in a ChartPanel with two range axis (one left and one right). For that plot, I let the user set the visibility for one of the range axis.
However, when I hide a range axis, the plot will resize to use more space, of course.
Is it possible to set a constant drawing "position" for that plot, so it does not resize when I show or hide one of the range axis (that way, the plot does not "jump" on showing/hiding an axis)?
Thanks a lot for your help!
Best regards,
Ben
Constant plot-position when setting axis visibility?
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: Constant plot-position when setting axis visibility?
If you want to see a blank area where the now invisible axis was drawn before, then I have no quick idea.
If you just want to keep the plot area/data area constant and make the JFreeChart shrink when you set an axis to invisible, then I recommend this thread and the earlier threads mentioned therein.
If you just want to keep the plot area/data area constant and make the JFreeChart shrink when you set an axis to invisible, then I recommend this thread and the earlier threads mentioned therein.
Re: Constant plot-position when setting axis visibility?
Maybe I could just override the ChartPanel / Chart / Plot (whereever the correct location is) and instead of making the axis invisible, just set it's color to transparent (so JFreeChart does think the axis is still there and does not change the size of the plot). Or is there already a property to set the color of the axis / axis labels?paradoxoff wrote:If you want to see a blank area where the now invisible axis was drawn before, then I have no quick idea.