1

I have a JFreeChart DialPlot with a title:

JFreeChart chart = new JFreeChart("A title", aDialPlot);

I would like to reduce the vertical spacing between the dial meter and the title on top of it but I couldn't find anything in the API.

Any help or hint would be greatly appreciated !

Thanks, Thomas

Tom
  • 1,375
  • 3
  • 24
  • 45

1 Answers1

1

You could leave the title off the chart, like they show here:

JFreeChart chart = new JFreeChart(aDialPlot);

And put the title on top of a square chart:

JPanel panel = new JPanel(new BorderLayout());
panel.add(new JLabel("A title"), BorderLayout.NORTH);
panel.add(new ChartPanel(chart) {
    @Override
    public Dimension getPreferredSize() {
        return new Dimension(300, 300);
    }
}, BorderLayout.CENTER);
Community
  • 1
  • 1
Catalina Island
  • 7,027
  • 2
  • 23
  • 42