Hello
I am using JfreeChart 1.0.11
I have created one chart like this
JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo 1", dataset, true, true, false);
Then, I have saved it into one JPG file
ChartUtilities.saveChartAsJPEG(new File("Test1.jpg"), chart, 300,300);
But, I would like replace 300, 300 with the width and height from the original chart to keep the good ratio.
How can I do it
Thank in advance.
How to get the width and height from one chart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: How to get the width and height from one chart
In JFreeChart, a chart doesn't have a width or a height. YOU give JFreeChart the dimensions, and then it tries to draw a nice looking chart within those constraints.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

