Hi,
I have sucessfully plotted the graphs using JFreeChart.
I would like to save the plotted graohs into files of type(GIF,JPEG,etc...anything like that)....
Can anyone give some handles on how to do this?
Thanks inadvance..
With Regards,
Rajendra.
How to save charts?
Re: How to save charts?
use the ChartUtilities classe and the method writeChartAs...
so you could save your chart in JPEG or PNG format.
so you could save your chart in JPEG or PNG format.
Re: How to save charts?
Thanks Benoit...
Other than JPEG and PNG , cann't i save the chart into formats like GIF,SVG,etc...
With Regards,
Rajendra.
Other than JPEG and PNG , cann't i save the chart into formats like GIF,SVG,etc...
With Regards,
Rajendra.
Re: How to save charts?
I tried Chartutilities class to save the chart.
Have glance at the following piece of code.
ChartUtilities chartutil = new ChartUtilities();
try
{
chartutil.saveChartAsJPEG (graphfile1,chart,450,450);
}
catch(Exception e)
{
System.out.println("exception");
}
It got compiled & ran sucessfully. But the chart was not saved.
What might be the problem?
I have tried with a print statement in the "TRY". It msg was printed,that means it is entering into the TRY stamt....
can any one help me in figuring out what is the problem?
With Ragards,
Rajendra.
Have glance at the following piece of code.
ChartUtilities chartutil = new ChartUtilities();
try
{
chartutil.saveChartAsJPEG (graphfile1,chart,450,450);
}
catch(Exception e)
{
System.out.println("exception");
}
It got compiled & ran sucessfully. But the chart was not saved.
What might be the problem?
I have tried with a print statement in the "TRY". It msg was printed,that means it is entering into the TRY stamt....
can any one help me in figuring out what is the problem?
With Ragards,
Rajendra.
Re: How to save charts?
since all the ChartUtilities methods are static, maybe try ChartUtilities.saveChartAsJPEG(file, chart, 450,450) ?