how to resize JFreeChartPanel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
anup

how to resize JFreeChartPanel

Post by anup » Sun Apr 07, 2002 9:00 am

Hi everyone,
1) In the demo program, in the JFreeChartFrame, the graph get's reduced to the frame size automatically. I have added a JFreeChartPanel to some other frame, but when the frame is resized, the chart doesn't get resized. how do i do it??
2) How can i print 2-4 graphs on one single page??

thanks
anup

David Gilbert

Re: how to resize JFreeChartPanel

Post by David Gilbert » Mon Apr 08, 2002 9:16 am

anup wrote:
> 1) In the demo program, in the JFreeChartFrame, the graph
> get's reduced to the frame size automatically. I have added a
> JFreeChartPanel to some other frame, but when the frame is
> resized, the chart doesn't get resized. how do i do it??

The frame size is determined by the layout manager.

> 2) How can i print 2-4 graphs on one single page??

The draw method in the JFreeChart class includes a chartArea parameter. When you are printing using the Java printing API, you need to write some code that determines the area on the page that each chart needs to occupy, then pass this to the draw method along with the Graphics2D instance supplied by the printing API.

In the demo application I just print one chart occupying the whole page, but you don't have to do it that way.

Regards,

DG.

anup

Re: how to resize JFreeChartPanel

Post by anup » Thu Apr 11, 2002 4:12 am

so how do i implement multiple charts printing in one page?? I mean what should i do to the code, do i have to implement my own class or do i have to just change some lines of code,
thanks
anup

Locked