How to increase the width of the Chart?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

How to increase the width of the Chart?

Post by nsurendiran » Tue Oct 27, 2009 10:33 am

Hi All,

I have defined a chart width as like below

Code: Select all

try
        { 
           OutputStream outStream = response.getOutputStream();
            response.setContentType("image/png");         
            ChartUtilities.writeChartAsPNG(outStream, chart, 1000, 500);
            outStream.flush();
            outStream.close();
            }catch (IOException e)
            {
            	System.err.println("Problem occurred creating chart.");
            	e.printStackTrace();
            }
Here the width is adjusted to the browser window. I have defined the rangeAxis to 24 hours in a day. Since the range values are displayed in HH:mm format like 00:00, it looks very close to next value. If I try to increase the width of the chart, it wont help.

I am expecting a wide display of the chart, so that user can use the horizontal scrollbar to scroll right or left to see the chart.

Does that make sense?

Any suggestions please welcome

Surendran

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to increase the width of the Chart?

Post by david.gilbert » Mon Nov 02, 2009 10:10 pm

nsurendiran wrote:If I try to increase the width of the chart, it wont help.
Why not? I'd expect that to work here.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Re: How to increase the width of the Chart?

Post by nsurendiran » Tue Nov 03, 2009 5:36 am

Hi David,

Thanks for the reply.

I realised that this is an issue with how I display the saved chart image to the browser.

If I directly write it into the browser, the image size is adjusted to the browser size. And I can see the real size of the image by only clicking the actual size button at the right bottom(IE 6.0), or clicking the zoom icon (Firefox).

this I came to know when I display the image using html <img> tag. But the work is little bit on the higher side for this. But I am living with that.

This is not an issue to discuss about the width is not working. Sorry for the confusion. I hope I made my point clear.

Thanks

Suren

Locked