Search code examples
gridjfreechartdimensions

JFreechart get grid display dimension


How can I get the DISPLAY dimensions of my grid squares in an XY plot. I can get the tick unit, but because the plot axis is adjusted to fit the dataset, equal tick units on both axis do not always look equal, maybe because one of the axis have a larger range of values. Is there any way to get the displayed dimensions of the grids, and not the tick unit. Thanks


Solution

  • You might be able to infer something useful from getBounds() on the ChartPanel and getInsets() on the Plot. Alternatively, specify a square container and setResizable(false).