Resize JFreeChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
paolo72
Posts: 3
Joined: Mon Sep 24, 2012 11:59 am
antibot: No, of course not.

Resize JFreeChart

Post by paolo72 » Mon Oct 22, 2012 12:24 pm

Hello,

I've created a JFreeChart embedded into a JPanel but I am not able to re-size the chart to let the plot fit exactly the dimension of the JPanel.
What type of parameters I need to re-define to let the chart being the same dimension of the JPanel?

Thanks in advance
P

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Resize JFreeChart

Post by John Matthews » Tue Oct 23, 2012 6:21 pm

Supply your org.jfree.chart.JFreeChart as a parameter to an org.jfree.chart.ChartPanel constructor. Add that panel to a Container having a layout that ignores the componet's preferred size, such as BorderLayout.CENTER. This example uses GridLayout.

Locked