The save-image feature (for plots) should remember the last directory saved to! It's really annoying when saving multiple plots when it doesn't!
What's slightly annoying is that JFreeChart has these methods:
File dir = chart.getDefaultDirectoryForSaveAs();
but doSaveAs() returns void so you can't find out what path was selected in the file chooser. getDefaultDirectoryForSaveAs() only returns what is set with setDefaultDirectoryForSaveAs().
But I don't want to set an arbitrary directory, I want to have the last directory saved to remembered! Short of trying to find a static hook in JFileChooser or somewhere else in the Java class library, I don't know whether this can be done at all!
The most recent version of JFreeChart (1.0.14in 2011) has no change to this API that I can see. There is a however a new development version on github so that needs to be explored.
What can be done however, is just to use a different method to write an image and a regular JFileChooser, e.g.
ChartUtilities.saveChartAsPNG(File file, JFreeChart chart, ...)
Fixed in 2.15.1
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.