I am using JFreeChart 1.0.14 . The labels of my axis are stretched very strange if the plot is too small / large. I want to disable this behavior and want the label labels to always print with the same width: height ratio.

Here is the SSCCE:
import java.awt.BorderLayout; import javax.swing.JFrame; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PlotOrientation; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; public class Main { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); XYSeries series = new XYSeries("series a"); for (int i = 0; i < 100; i++) series.add(i, Math.sin(i / 2.0) * Math.cos(i / (2.0 + Math.random()))); XYSeriesCollection dataset = new XYSeriesCollection(series); JFreeChart chart = ChartFactory.createXYLineChart("", "x-axis", "y-axis", dataset, PlotOrientation.VERTICAL, false, false, false); ChartPanel panel = new ChartPanel(chart); frame.add(panel, BorderLayout.CENTER); frame.setSize(400, 200); frame.setLocationRelativeTo(null); frame.setVisible(true); } }
It produces output labeled OK . When I change the frame size in any direction by a certain amount, the cue marks (and cue marks) begin to distort (as can be seen from the two frames marked with a stretched sign). And their "stretch ratio" is synchronized.
I canβt figure out how to disable this βfunctionβ and always show axis labels with a fixed ratio of width and height. Do you know how to do this?
source share