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
how to resize JFreeChartPanel
Re: how to resize JFreeChartPanel
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.
> 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.
Re: how to resize JFreeChartPanel
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
thanks
anup