Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartCreator.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartCreator.java	(revision 2752)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartCreator.java	(revision 2753)
@@ -63,55 +63,6 @@
 	
 	
 	/**
-	 * Creates a chart file using the current ChartCreator prefix for the file name.
-	 *
-	 * @param result
-	 * @param fileNamePrefix
-	 * @return
-	 */
-	public File createChartFile(R result, File file, int imageWidth, int imageHeight) {
-		// this.createChartFile(result, this.chartsEngine.createTmpFile(fileNamePrefix));
-		if (file == null) {
-			file = this.chartsEngine.createTmpFile(this.fileNamePrefix);
-		}
-		// this.createChart(result);
-		// this.updateChart(result);
-		this.chartsEngine.exportChart(result.getChart(), file, this.chartsEngine.getOutputFormat(), imageWidth, imageHeight);
-		// result.setChart(file);
-		
-		return file;
-	}
-	
-	// /**
-	// * Creates a chart file according to the specified result data and parameters.
-	// * @param result
-	// * @param file
-	// * @return
-	// */
-	// public File createChartFile(ChartResult result, File file) {
-	// Object chart = this.createChart(result);
-	// // FIXME: SJ: became useless?
-	// // Synchronizes the chart with the shared preferences as show title, show legend, rendering colors mode, etc.
-	// //this.updateChart(result);
-	// return this.chartsEngine.createChartFile(chart, file);
-	// }
-	//
-	// /**
-	// * Creates a chart file according to the specified result data using the specified prefix for the file name.
-	// * @param result
-	// * @param fileNamePrefix
-	// * @return
-	// */
-	// public File createChartFile(ChartResult result, String fileNamePrefix) {
-	// return this.createChartFile(result, this.chartsEngine.createTmpFile(fileNamePrefix));
-	// }
-	//
-	
-	
-	
-	
-	
-	/**
 	 * Updates an existing chart.
 	 * By default this method does nothing.
 	 * Subclasses should override this method to update a chart without recreating one.
@@ -120,7 +71,6 @@
 	 * 
 	 * @param result
 	 * @param preferencesNode
-	 * @return
 	 */
 	public void updateChart(R result) {
 		Log.severe("ChartCreator.updateChart(): not implemented. This method is intended to be overridden in subclasses."); //$NON-NLS-1$
@@ -182,7 +132,7 @@
 	}
 	
 	
-	
+	//TODO to be cleaned later
 	// /**
 	// * Creates a chart file according to the specified result data and parameters.
 	// *
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 2752)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 2753)
@@ -32,6 +32,9 @@
 	
 	/**
 	 * The chart object.
+	 * TODO: MD: this is problematic, the chart object should allow us to edit the chart. In the case of the R charts, the File has not the same value as the JFC Chart (which can be edited)
+	 * TODO: replace this with at least a ChartResult parameter such as <O extends Object> but a abstract <C extends org.txm.Chart> would be better even if is only an empty class -> avoid compilation
+	 * TODO: error and upgrade the readability of the code and avoid unnecessary casts
 	 */
 	protected Object chart;
 	
@@ -64,6 +67,8 @@
 	
 	/**
 	 * The chart type;
+	 * TODO MD: finalize the chart type parameter. The chart type is directly linked to the ChartCreator classes and should not be a simple String -> this will allow us to manage this pref correctly
+	 * in the autosave&load methods
 	 */
 	@Parameter(key = ChartsEnginePreferences.CHART_TYPE, type = Parameter.RENDERING)
 	protected String chartType;
@@ -308,9 +313,11 @@
 			// The change of the chart type parameter can occur if:
 			// - the chart has never been created
 			// - the chart type has been changed, e.g. to dynamically change the type of chart or the current charts engine
-			if (this.chart == null || this.getLastParametersFromHistory() == null ||
-					(this.getLastParametersFromHistory().get(ChartsEnginePreferences.CHART_TYPE) != null &&
-							this.hasParameterChanged(ChartsEnginePreferences.CHART_TYPE))
+			if (this.chart == null
+			// MD: the following tests are no more necessary since chartResult dirty state has been already resolved
+			// || this.getLastParametersFromHistory() == null ||
+			// (this.getLastParametersFromHistory().get(ChartsEnginePreferences.CHART_TYPE) != null &&
+			// this.hasParameterChanged(ChartsEnginePreferences.CHART_TYPE))
 			// )
 			
 			) {
@@ -475,9 +482,13 @@
 	 * @param chartType the chartType to set
 	 */
 	public void setChartType(String chartType) {
+		if (!this.chartType.equals(chartType)) {
+			// TODO find a better way to switch chart creators. this way previous chart is lost.
+			setChart(null); // the chart must be redrawn from scratch
+		}
 		this.chartType = chartType;
 		
-		// FIXME: SJ: need to validate this
+		// FIXME: SJ: need to validate this MD: this seems no more necessary since the chart object is reset just before
 		HashMap<String, Object> last = this.getLastParametersFromHistory();
 		if (last != null) {
 			this.getLastParametersFromHistory().put(ChartsEnginePreferences.CHART_TYPE, "__undef___"); //$NON-NLS-1$
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 2752)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 2753)
@@ -381,6 +381,43 @@
 		return file;
 	}
 	
+	/**
+	 * Creates a uniq temporary file in USER_TXM_HOME\results with a specified prefix given by the ChartCreator of the result for writing the chart.
+	 * The suffix is computed according to the current output format of the charts engine.
+	 * 
+	 * @return the uniq file
+	 */
+	public File createUniqTmpFile(ChartResult result) {
+		return createUniqTmpFile(result, result.getChartCreator().getFileNamePrefix());
+	}
+	
+	/**
+	 * Creates a uniq temporary file in USER_TXM_HOME\results with the specified prefix for writing the chart.
+	 * 
+	 * The suffix is computed according to the current output format of the charts engine.
+	 * 
+	 * @return the uniq file
+	 */
+	public File createUniqTmpFile(ChartResult result, String prefix) {
+		
+		File file = null;
+		File resultsDir = new File(Toolbox.getTxmHomePath(), "results"); //$NON-NLS-1$
+		resultsDir.mkdirs();
+		
+		// right padding to 3 characters long
+		if (prefix.length() < 3) {
+			prefix = String.format("%1$-3s", prefix).replace(' ', '_'); //$NON-NLS-1$
+		}
+		
+		file = new File(resultsDir, result.getChartCreator().getFileNamePrefix() + result.getParametersNodePath().replaceAll("/", "_") + "." + this.outputFormat);
+		
+		// TODO : old code, useful ? and/or return null instead of the file if canWrite() return false ?
+		if (!resultsDir.canWrite()) {
+			Log.severe(NLS.bind(ChartsEngineCoreMessages.error_cantWriteInFileP0, file));
+		}
+		return file;
+	}
+	
 	// public File createChartFile(ChartResult result);
 	
 	// /**
@@ -422,7 +459,7 @@
 	// // FIXME: SJ: became useless?
 	// // Synchronizes the chart with the shared preferences as show title, show legend, rendering colors mode, etc.
 	// // this.updateChart(result);
-	// return this.exportChart(chart, file, this.outputFormat, 0, 0);
+	// return this.exportChartToFile(chart, file, this.outputFormat, 0, 0);
 	// }
 	
 	
@@ -452,21 +489,10 @@
 	 * @param drawingAreaHeight
 	 * @return
 	 */
-	public abstract File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight);
+	public abstract File exportChartToFile(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth,
+			int drawingAreaHeight);
 	
-	
 	/**
-	 * Export a chart in a file
-	 * 
-	 * @param result
-	 * @param outputFormat
-	 * @return
-	 */
-	public abstract File exportChart(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat);
-	
-	
-	
-	/**
 	 * Exports the chart to the specified file.
 	 * 
 	 * @param chart
@@ -476,33 +502,46 @@
 	 * @param imageHeight
 	 * @return
 	 */
-	public File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight) {
-		return this.exportChart(chart, file, outputFormat, imageWidth, imageHeight, 0, 0, imageWidth, imageHeight);
+	public File exportChartToFile(Object chart, File file, String outputFormat, int imageWidth, int imageHeight) {
+		return this.exportChartToFile(chart, file, outputFormat, imageWidth, imageHeight, 0, 0, imageWidth, imageHeight);
 	}
 	
 	/**
-	 * Export a chart in a file
+	 * Export a chart in a result file. The file path is generated and uniq for a result
 	 * 
+	 * image size is set to 1024x576
+	 * 
 	 * @param result
 	 * @param outputFormatSvg
 	 * @return
 	 */
-	public File exportChart(ChartResult result, String outputFormat) {
-		return exportChart(result, 1024, 576, outputFormat);
+	public File writeResultFile(ChartResult result, String outputFormat) {
+		return writeChartResultFile(result, 1024, 576, outputFormat);
 	}
 	
 	/**
-	 * Export a chart in a file
+	 * Export a chart in a result file. The file path is generated and uniq for a result
 	 * 
 	 * @param result
+	 * @param imageWidth image width
+	 * @param imageHeight image height
 	 * @param outputFormatSvg
 	 * @return
 	 */
-	public File exportChart(ChartResult result, int imageWidth, int imageHeight, String outputFormat) {
-		return exportChart(result, createTmpFile("export"), imageWidth, imageHeight, outputFormat); // $NON-NLS-1$
+	public File writeChartResultFile(ChartResult result, int imageWidth, int imageHeight, String outputFormat) {
+		return exportResultToFile(result, createUniqTmpFile(result), imageWidth, imageHeight, outputFormat);
 	}
 	
 	/**
+	 * Export a chart in a file
+	 * 
+	 * @param result
+	 * @param outputFormatSvg
+	 * @return
+	 */
+	public abstract File exportResultToFile(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat);
+	
+	/**
 	 * Gets the current output format.
 	 * 
 	 * @return
Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java	(revision 2752)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java	(revision 2753)
@@ -122,18 +122,16 @@
 	
 	
 	@Override
-	public void updateChart(CA ca) {
+	public File createChart(CA ca, File file) {
 		
-		File chart = (File) ca.getChart();
-		
 		// FactoMineR R package
 		if (ca.useFactoMineR()) {
-			this.createFactorialMapChart((FactoMineRCA) ca.getCA(), chart, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca.getSecondDimension(), Utils
+			return this.createFactorialMapChart((FactoMineRCA) ca.getCA(), file, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca.getSecondDimension(), Utils
 					.createCAFactorialMapChartTitle(ca));
 		}
 		// CA R package
 		else {
-			this.createFactorialMapChart((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), chart, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca
+			return this.createFactorialMapChart((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), file, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca
 					.getSecondDimension());
 		}
 	}
Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/REigenvaluesChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/REigenvaluesChartCreator.java	(revision 2752)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/REigenvaluesChartCreator.java	(revision 2753)
@@ -22,19 +22,17 @@
 public class REigenvaluesChartCreator extends RChartCreator<Eigenvalues> {
 	
 	@Override
-	public void updateChart(Eigenvalues result) {
+	public File createChart(Eigenvalues result, File file) {
 		
 		CA ca = result.getCA();
-		File chart = (File) result.getChart();
 		
-		
 		// FactoMineR R package
 		if (ca.useFactoMineR()) {
-			this.createSingularValuesBarPlot((FactoMineRCA) ca.getCA(), chart);
+			return this.createSingularValuesBarPlot((FactoMineRCA) ca.getCA(), file);
 		}
 		// CA R package
 		else {
-			this.createSingularValuesBarPlot((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), chart);
+			return this.createSingularValuesBarPlot((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), file);
 		}
 	}
 	
Index: tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java	(revision 2752)
+++ tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java	(revision 2753)
@@ -102,7 +102,7 @@
 	 * @see org.txm.chartsengine.core.ChartsEngine#exportChart(java.lang.Object, java.io.File, java.lang.String, int, int, int, int, int, int)
 	 */
 	@Override
-	public File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
+	public File exportChartToFile(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
 		// TODO Auto-generated method stub
 		return null;
 	}
@@ -128,9 +128,16 @@
 	}
 	
 	@Override
-	public File exportChart(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormatSvg) {
+	public File exportResultToFile(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormatSvg) {
 		// TODO Auto-generated method stub
 		return null;
 	}
 	
+	
+	@Override
+	public File writeChartResultFile(ChartResult result, int imageWidth, int imageHeight, String outputFormat) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
 }
Index: tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/swt/RasterComposite.java
===================================================================
--- tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/swt/RasterComposite.java	(revision 2752)
+++ tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/swt/RasterComposite.java	(revision 2753)
@@ -1,22 +1,19 @@
 package org.txm.chartsengine.raster.rcp.swt;
 
-import java.awt.Component;
 import java.io.File;
 import java.util.ArrayList;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
-import org.txm.chartsengine.core.ChartsEngine;
-import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.chartsengine.rcp.IChartComponent;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
-import org.txm.chartsengine.rcp.editors.ChartEditorInput;
 import org.txm.chartsengine.rcp.events.EventCallBackHandler;
 import org.txm.chartsengine.rcp.swt.ChartComposite;
 import org.txm.core.messages.TXMCoreMessages;
@@ -64,7 +61,7 @@
 		this.imageLabel = new Label(this, SWT.NONE);
 		
 		// FIXME: SJ: for debugging purpose
-		this.imageLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
+		//this.imageLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
 		
 		// this.imageLabel = new Label(this, SWT.NONE);
 		// this.imageLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
@@ -124,66 +121,34 @@
 	
 	@Override
 	public void loadChart(Object chart) {
-		
-		// need to be async (the composite needs to be realized before using its size in export)
-		Display.getDefault().asyncExec(new Runnable() {
-			
-			@Override
-			public void run() {
-				// create the chart file if not of the right type
-				if (!(chart instanceof File)) {
-					ChartResult result = chartEditor.getResult();
-					// result.setChart(null);
-					file = chartEditor.getSWTChartsComponentsProvider().getChartsEngine().getChartCreator(result).createChartFile(result, file, getParent().getSize().x, getParent().getSize().y);
-					// result.setChart(this.file);
-				}
-				else {
-					file = (File) chart;
-				}
-				
-				loadRasterFile(file);
-				
-			}
-		});
-		
+		if (chart instanceof File) {
+			this.loadRasterFile((File) chart);
+		} else {
+			Log.warning("RasterComposite can't load a chart which is not a file: "+chart);
+		}
 	}
 	
-	
-	
 	@Override
 	public void loadChart() {
-		
-		this.loadChart(this.chartEditor.getChart());
-		
-		// // loads the chart from the result
-		// Object chart = this.chartEditor.getChart();
-		//
-		// if (chart != null) {
-		//
-		// // creates components if they not exist
-		// if (this.chartComponent == null) {
-		//
-		// // recreates the chart if needed
-		// if (this.chartEditor.getResult().isChartDirty()) {
-		// try {
-		// // this.chartEditor.getResult().clearLastRenderingParameters(); // FIXME: SJ: seems to became useless
-		// this.chartEditor.getResult().compute();
-		// }
-		// catch (Exception e) {
-		// e.printStackTrace();
-		// }
-		// }
-		//
-		// this.createChartComponent();
-		//
-		// this.loadChart(this.chartEditor.getChart());
-		// }
-		// }
-		
+		// this.file = (File) this.chartComponent;
+		Point size = getSize();
+		int w = size.x;
+		int h = size.y;
+		if (size.x != 0 && size.y != 0) { 
+			// the widget size might not be ready at this moment, see ChartEditor.loadChart() method
+			// alternative solution is to wrap this in a Display.asyncExec call to be sure the size is ready
+			w = 800;
+			h = 600;
+		}
+		this.file = this.getChartsEngine().writeChartResultFile(this.getChartResult(), w, h, this.getChartsEngine().getOutputFormat());
+		this.loadRasterFile(this.file);
 	}
 	
 	
 	
+
+	
+	
 	/**
 	 * Loads a raster image from the specified file.
 	 * 
Index: tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartsEngine.java	(revision 2752)
+++ tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartsEngine.java	(revision 2753)
@@ -5,6 +5,7 @@
 import java.util.ArrayList;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.core.ChartsEngine;
 import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.chartsengine.r.core.preferences.RChartsEnginePreferences;
@@ -68,19 +69,50 @@
 		this(RChartsEnginePreferences.getInstance().getString(RChartsEnginePreferences.OUTPUT_FORMAT));
 	}
 	
-	
+	/**
+	 * Export a chart in a file
+	 * 
+	 * @param result
+	 * @param outputFormatSvg
+	 * @return
+	 */
 	@Override
-	public File exportChart(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat) {
-		return this.exportChart(result.getChart(), file, outputFormat, imageWidth, imageHeight, -1, -1, -1, -1);
+	public File writeChartResultFile(ChartResult result, int imageWidth, int imageHeight, String outputFormat) {
+		return exportResultToFile(result, null, imageWidth, imageHeight, outputFormat);
 	}
 	
 	
 	@Override
-	public File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
-		// FIXME: Not yet implemented
+	public File exportResultToFile(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat) {
+		Object chart = result.getChart();
+		if (chart == null) {
+			Log.warning("Error: no chart to export (null). The result was never computed?");
+			return null;
+		}
+		
+		if (!(chart instanceof File)) {
+			Log.warning("Error: RChartEngine only manage File charts: " + chart);
+			return null;
+		}
+		
+		if (this.getOutputFormat().equals(outputFormat)) {//
+			if (!((File) chart).exists()) {
+				result.getChartCreator().updateChart(result);
+			}
+			
+			return exportChartToFile(chart, file, outputFormat, imageWidth, imageHeight);
+		}
+		else {
+			Log.warning(NLS.bind("Error: RChartEngine export format ({0}) cannot differ from the current display format ({1})", outputFormat, this.getOutputFormat()));
+		}
+		return null;
+	}
+	
+	@Override
+	public File exportChartToFile(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
 		Log.finest(this.getClass() + ".exportChart(): Not fully implemented. Output format, Image dimensions and cropping are not implemented.");
 		
-		if (file.equals(chart)) {
+		if (file == null || file.equals(chart)) {
 			return (File) chart; // no need to redraw the chart
 		}
 		else {
@@ -92,11 +124,10 @@
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
-			return null;
 		}
+		return null;
 	}
 	
-	
 	/**
 	 * Plots the specified expression using R workspace instance and current charts engine output format.
 	 * 
Index: tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java
===================================================================
--- tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java	(revision 2752)
+++ tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java	(revision 2753)
@@ -13,27 +13,51 @@
 /**
  * R base chart creator.
  * 
+ * Currently the R chart creator can't update a chart = a File. It is always recreated in the updateChart method
+ * 
+ * An empty file is created in the createChart method
+ * 
  * @author sjacquot
  *
  */
 public abstract class RChartCreator<R extends ChartResult> extends ChartCreator<RChartsEngine, R> {
 	
-	
+	/**
+	 * creates an empty file. the chart will be written after in the updateChart method
+	 */
 	@Override
 	public Object createChart(R result) {
-		// creates a new chart file if not exist
-		if (result.getChart() == null) {
-			File chart = this.getChartsEngine().createTmpFile(this.getFileNamePrefix());
-			result.setChart(chart);
-			return chart;
+		if (result.getChart() != null && result.getChart() instanceof File) { // we can re-use the file if already defined
+			return result.getChart();
 		}
 		else {
-			return result.getChart();
+			return this.getChartsEngine().createUniqTmpFile(result, this.getFileNamePrefix());
 		}
 	}
 	
+	/**
+	 * Effectively writes the R chart in the given file
+	 * 
+	 * @param result
+	 * @param file the file to write. not null
+	 * @return
+	 */
+	public abstract File createChart(R result, File file);
 	
 	@Override
+	public void updateChart(R result) {
+		
+		Object chart = result.getChart();
+		
+		if (chart instanceof File) { // The RChartCreators can't really update a chart -> the chart is always recreated
+			createChart(result, (File) chart);
+		}
+		else {
+			Log.warning("Error: R chart was null in: " + result);
+		}
+	}
+	
+	@Override
 	public ArrayList<Color> getSeriesShapesColors(Object chart) {
 		Log.severe(this.getClass() + ".getSeriesShapesColors(): Not yet implemented."); //$NON-NLS-1$
 		return null;
Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java	(revision 2752)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java	(revision 2753)
@@ -24,12 +24,11 @@
 	
 	
 	@Override
-	public void updateChart(SpecificitiesSelection result) {
+	public File createChart(SpecificitiesSelection result, File file) {
 		
 		try {
 			
 			SpecificitiesSelection specificitiesSelection = result;
-			File chart = (File) result.getChart();
 			
 			// parameters
 			boolean transpose = specificitiesSelection.isGroupingByLines();
@@ -161,13 +160,15 @@
 			}
 			
 			// Plot all
-			this.getChartsEngine().plot(chart, cmd);
+			this.getChartsEngine().plot(file, cmd);
 			
 			
 		}
 		catch (Exception e) {
 			Log.severe(SpecificitiesCoreMessages.bind(SpecificitiesCoreMessages.cantCreateSpecificitiesChartFileChartsEngineColonP0, this.getChartsEngine().getName()) + e);
 		}
+		
+		return file;
 	}
 	
 	
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 2753)
@@ -5,6 +5,7 @@
 import java.util.ArrayList;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
@@ -17,7 +18,6 @@
 import org.eclipse.ui.contexts.IContextService;
 import org.eclipse.ui.part.MultiPageEditorPart;
 import org.txm.chartsengine.core.ChartsEngine;
-import org.txm.chartsengine.core.ChartsEnginesManager;
 import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.messages.ChartsUIMessages;
@@ -288,7 +288,6 @@
 		// check that the charts engine used for the result matches the SWT components provider otherwise find a suitable components provider
 		// and recreate new ChartComposite and ChartComponent
 		if (this.getResult().getChartsEngine() != this.swtChartsComponentsProvider.getChartsEngine()) {
-			// if (this.getResult().getChartsEngine() != ChartsEnginesManager.getInstance().getCurrentEngine()) {
 			
 			Log.finest("ChartEditor.updateEditorFromResult(): result charts engine  = " + this.getResult().getChartsEngine().getName() + " / Editor charts engine = " + this.swtChartsComponentsProvider //$NON-NLS-1$ //$NON-NLS-2$
 					.getChartsEngine().getName() + ".");  //$NON-NLS-1$
@@ -482,16 +481,33 @@
 	 * @param clearChartItemsSelection
 	 */
 	public void loadChart() {
-		this.getSite().getShell().getDisplay().syncExec(new Runnable() {
-			
-			@Override
-			public void run() {
-				chartComposite.loadChart(
-						getResult().needsToResetView(),
-						getResult().needsToClearItemsSelection(),
-						getResult().needsToSquareOff());
-			}
-		});
+		
+		
+		Point size = chartComposite.getSize();
+		if (size.x == 0 || size.y == 0) { // MD: using asyncExec should force the chartComposite to be displayed before loading the chart
+			this.getSite().getShell().getDisplay().asyncExec(new Runnable() {
+				
+				@Override
+				public void run() {
+					chartComposite.loadChart(
+							getResult().needsToResetView(),
+							getResult().needsToClearItemsSelection(),
+							getResult().needsToSquareOff());
+				}
+			});
+		}
+		else { // TODO MD: remove this duplicated code using lambdas
+			this.getSite().getShell().getDisplay().syncExec(new Runnable() {
+				
+				@Override
+				public void run() {
+					chartComposite.loadChart(
+							getResult().needsToResetView(),
+							getResult().needsToClearItemsSelection(),
+							getResult().needsToSquareOff());
+				}
+			});
+		}
 	}
 	
 	
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java	(revision 2753)
@@ -82,6 +82,10 @@
 	
 	/**
 	 * Loads or reloads the chart from the chart object stored in the linked editor input.
+	 * 
+	 * This method is especially used for file based implementations of charts engine for reloading a file that has been externally modified.
+	 * 
+	 * This methods works only if used with a ChartEditor (the ChartEditor allows to retrieve the ChartResult and the chart to display)
 	 */
 	public abstract void loadChart();
 	
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java	(revision 2753)
@@ -539,16 +539,16 @@
 			// creates components if they not exist
 			if (this.chartComponent == null) {
 				
-				// recreates the chart if needed
-				if (this.chartEditor.getResult().isChartDirty()) {
-					try {
-						// this.chartEditor.getResult().clearLastRenderingParameters(); // FIXME: SJ: seems to became useless
-						this.chartEditor.getResult().compute();
-					}
-					catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
+				// // recreates the chart if needed
+				// if (this.chartEditor.getResult().isChartDirty()) {
+				// try {
+				// // this.chartEditor.getResult().clearLastRenderingParameters(); // FIXME: SJ: seems to became useless
+				// this.chartEditor.getResult().compute();
+				// }
+				// catch (Exception e) {
+				// e.printStackTrace();
+				// }
+				// }
 				
 				this.createChartComponent();
 				
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java	(revision 2753)
@@ -243,8 +243,7 @@
 					String[] data = StringUtils.split(chartTypeCombo.getItem(chartTypeCombo.getSelectionIndex()), '/');
 					data[0] = StringUtils.trim(data[0]);
 					data[1] = StringUtils.trim(data[1]);
-					getEditorPart().getResult().setChart(null);
-					getEditorPart().getResult().setChartType(data[1]);
+					getEditorPart().getResult().setChartType(data[1]); // reset the chart
 					getEditorPart().getResult().setChartsEngine((ChartsEngine) Toolbox.getEngineManager(EngineType.CHARTS).getEngine(data[0]));
 					update = false;
 				}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveUpChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveUpChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveUpChartView.java	(revision 2753)
@@ -3,13 +3,15 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
- * Resets the chart view of the active chart editor part.
+ * Moves up the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author mdecorde
  *
  */
 public class MoveUpChartView extends AbstractHandler {
@@ -23,7 +25,7 @@
 			chartEditor.pan(0, 0, 0, 1, 0.1);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while moving up in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomInChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomInChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomInChartView.java	(revision 2753)
@@ -3,14 +3,16 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.graphics.Point;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
  * Resets the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author mdecorde
  *
  */
 public class ZoomInChartView extends AbstractHandler {
@@ -25,7 +27,7 @@
 			chartEditor.zoom(p.x / 2, p.y / 2, true);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while zooming in in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomOutChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomOutChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ZoomOutChartView.java	(revision 2753)
@@ -3,14 +3,16 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.graphics.Point;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
- * Resets the chart view of the active chart editor part.
+ * Zoom the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author mdecorde
  *
  */
 public class ZoomOutChartView extends AbstractHandler {
@@ -25,7 +27,7 @@
 			chartEditor.zoom(p.x / 2, p.y / 2, false);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while zooming out in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveDownChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveDownChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveDownChartView.java	(revision 2753)
@@ -3,11 +3,13 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
- * Resets the chart view of the active chart editor part.
+ * Moves down the chart view of the active chart editor part.
  * 
  * @author sjacquot
  *
@@ -23,7 +25,7 @@
 			chartEditor.pan(0, 0, 0, -1, 0.1);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while moving down in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveLeftChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveLeftChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveLeftChartView.java	(revision 2753)
@@ -3,13 +3,15 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
- * Resets the chart view of the active chart editor part.
+ * Moves to the left the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author mdecorde
  *
  */
 public class MoveLeftChartView extends AbstractHandler {
@@ -23,7 +25,7 @@
 			chartEditor.pan(0, 0, -1, 0, 0.1);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while moving to the left in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ResetChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ResetChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ResetChartView.java	(revision 2753)
@@ -3,18 +3,19 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
  * Resets the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author sjacquot, mdecorde
  *
  */
 public class ResetChartView extends AbstractHandler {
-
-
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		ChartEditor chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event);
@@ -23,9 +24,9 @@
 			chartEditor.resetView();
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while resetting view in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
-
+	
 }
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveRightChartView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveRightChartView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/MoveRightChartView.java	(revision 2753)
@@ -3,13 +3,15 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditor;
+import org.txm.utils.logger.Log;
 
 /**
- * Resets the chart view of the active chart editor part.
+ * Moves right the chart view of the active chart editor part.
  * 
- * @author sjacquot
+ * @author mdecorde
  *
  */
 public class MoveRightChartView extends AbstractHandler {
@@ -23,7 +25,7 @@
 			chartEditor.pan(0, 0, 1, 0, 0.1);
 		}
 		catch (Exception e) {
-			// nothing to do
+			Log.warning(NLS.bind("Error while moving to the right in {0}: {1}.", chartEditor, e));
 		}
 		return chartEditor;
 	}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChart.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChart.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChart.java	(revision 2753)
@@ -143,7 +143,7 @@
 						}
 						
 						String outputFormat = SWTChartsComponentsProvider.getCurrent().getChartsEngineSupportedExportFileFormats().get(dialog.getFilterIndex());
-						ChartsEngine.getCurrent().exportChart(chartResult, file, 1024, 576, outputFormat);
+						ChartsEngine.getCurrent().exportResultToFile(chartResult, file, 1024, 576, outputFormat);
 						
 						if (file.exists()) {
 							
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java	(revision 2752)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java	(revision 2753)
@@ -49,7 +49,6 @@
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.rcp.JobsTimer;
-import org.txm.rcp.StatusLine;
 import org.txm.rcp.commands.OpenGraph;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.swt.dialog.LastOpened;
@@ -65,30 +64,30 @@
  *
  */
 public class ExportChartEditorView extends AbstractHandler implements IHandler2 {
-
+	
 	public static final String ID = "org.txm.chartsengine.rcp.handlers.ExportChartEditorView"; //$NON-NLS-1$
-
 	
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
+		
 		final ChartEditor chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event);
 		
 		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
 		final FileDialog dialog = new FileDialog(shell, SWT.SAVE);
-
+		
 		// Create the file extensions from the current chart editor supported file formats
 		String extensions[] = new String[chartEditor.getEditorSupportedExportFileFormats().size()];
 		int defaultChartFormatIndex = 0;
-		for(int i = 0; i < chartEditor.getEditorSupportedExportFileFormats().size(); i++) {
+		for (int i = 0; i < chartEditor.getEditorSupportedExportFileFormats().size(); i++) {
 			extensions[i] = "*." + chartEditor.getEditorSupportedExportFileFormats().get(i); //$NON-NLS-1$
-
+			
 			// Store the default chart export file format index
-			if(ChartsEnginePreferences.getInstance().getString(ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT).equals(chartEditor.getEditorSupportedExportFileFormats().get(i)))	{
+			if (ChartsEnginePreferences.getInstance().getString(ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT).equals(chartEditor.getEditorSupportedExportFileFormats().get(i))) {
 				defaultChartFormatIndex = i;
 			}
 		}
-
+		
 		dialog.setFilterExtensions(extensions);
 		
 		// Select default chart export file format according to the user preferences
@@ -97,13 +96,13 @@
 		dialog.setFileName(chartEditor.getResult().getValidFileName());
 		
 		dialog.setOverwrite(true);
-
-
-		if(LastOpened.getFile(ID) != null) {
+		
+		
+		if (LastOpened.getFile(ID) != null) {
 			dialog.setFilterPath(LastOpened.getFolder(ID));
 		}
-
-		if(dialog.open() != null) {
+		
+		if (dialog.open() != null) {
 			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
 			String suffix = extensions[dialog.getFilterIndex()].substring(1); // get selected extension and remove the character '*'
 			if (!filepath.endsWith(suffix)) {
@@ -112,37 +111,39 @@
 			final File file = new File(filepath);
 			
 			LastOpened.set(ID, file.getParent(), file.getName());
-
+			
 			try {
 				file.createNewFile();
 			}
-			catch(IOException e1) {
+			catch (IOException e1) {
 				Log.severe(TXMCoreMessages.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, file, e1));
 			}
-			if(!file.canWrite()) {
+			if (!file.canWrite()) {
 				Log.severe(TXMCoreMessages.bind(TXMUIMessages.impossibleToReadP0, file));
 			}
-			if(!file.isFile()) {
+			if (!file.isFile()) {
 				Log.severe(TXMCoreMessages.bind("Error: {0} is not a file.", file));
 			}
-
+			
 			JobHandler jobhandler = new JobHandler(TXMCoreMessages.bind("Exporting current chart view to file {0}...", file.getAbsolutePath())) {
+				
 				@Override
 				protected IStatus run(IProgressMonitor monitor) {
 					try {
 						this.runInit(monitor);
 						monitor.beginTask(TXMUIMessages.exporting, 100);
-
+						
 						String outputFormat = (String) chartEditor.getEditorSupportedExportFileFormats().get(dialog.getFilterIndex());
 						chartEditor.exportView(file, outputFormat);
-
-						if(file.exists()) {
-
+						
+						if (file.exists()) {
+							
 							Log.info(NLS.bind(TXMUIMessages.p1ExportSavedInFileColonP0, file.getAbsolutePath(), outputFormat.toUpperCase()));
-
+							
 							// Open internal editor in the UI thread
-							if(TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPORT_SHOW))	{
+							if (TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPORT_SHOW)) {
 								this.syncExec(new Runnable() {
+									
 									@Override
 									public void run() {
 										OpenGraph.OpenFile(file.getAbsolutePath());
@@ -154,10 +155,10 @@
 							Log.severe(NLS.bind(TXMUIMessages.failedToExportInFileP0WithFormatP1, file.getAbsolutePath(), outputFormat));
 						}
 					}
-					catch(ThreadDeath td) {
+					catch (ThreadDeath td) {
 						return Status.CANCEL_STATUS;
 					}
-					catch(Exception e) {
+					catch (Exception e) {
 						org.txm.utils.logger.Log.printStackTrace(e);
 						return Status.CANCEL_STATUS;
 					}
@@ -168,10 +169,10 @@
 					return Status.OK_STATUS;
 				}
 			};
-
+			
 			jobhandler.startJob();
-
+			
 		}
 		return null;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java	(revision 2752)
+++ tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java	(revision 2753)
@@ -439,14 +439,14 @@
 	
 	//
 	@Override
-	public File exportChart(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat) {
+	public File exportResultToFile(ChartResult result, File file, int imageWidth, int imageHeight, String outputFormat) {
 		Object chart = result.getChart();
 		if (chart == null) {
 			Log.severe("Error: null chart in " + result);
 			return null;
 		}
 		if (chart instanceof JFreeChart) {
-			return exportChart(chart, file, outputFormat, imageWidth, imageHeight); // create & write a
+			return exportChartToFile(chart, file, outputFormat, imageWidth, imageHeight); // create & write a
 		}
 		else {
 			Log.severe("Error: the chart is not a JFreeChart " + chart + " " + result);
@@ -460,7 +460,7 @@
 	// }
 	
 	@Override
-	public File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
+	public File exportChartToFile(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
 		return JFCChartsEngine.export(chart, file, outputFormat, imageWidth, imageHeight, drawingAreaX, drawingAreaY, drawingAreaWidth, drawingAreaHeight);
 	}
 	
@@ -863,7 +863,7 @@
 		// FIXME: removed for the Raster image rendering colors mode works
 		// this.theme.apply(chart);
 		
-		return this.exportChart(chart, file, this.outputFormat, 800, 600);
+		return this.exportChartToFile(chart, file, this.outputFormat, 800, 600);
 		
 	}
 	
@@ -1151,6 +1151,4 @@
 	public String getName() {
 		return JFCChartsEngine.NAME;
 	}
-	
-	
 }
Index: tmp/org.txm.ahc.core/src/org/txm/ahc/core/chartsengine/r/RAHCChartCreator.java
===================================================================
--- tmp/org.txm.ahc.core/src/org/txm/ahc/core/chartsengine/r/RAHCChartCreator.java	(revision 2752)
+++ tmp/org.txm.ahc.core/src/org/txm/ahc/core/chartsengine/r/RAHCChartCreator.java	(revision 2753)
@@ -15,10 +15,9 @@
 public class RAHCChartCreator extends RChartCreator<AHC> {
 	
 	@Override
-	public void updateChart(AHC result) {
+	public File createChart(AHC result, File file) {
 		
 		AHC ahc = result;
-		File chart = (File) result.getChart();
 		
 		String cmd = null;
 		// 2D
@@ -37,7 +36,7 @@
 			cmd = "plot.HCPC(" + ahc.getRSymbol() + ", new.plot=FALSE)";
 		}
 		
-		this.getChartsEngine().plot(chart, cmd);
+		return this.getChartsEngine().plot(file, cmd);
 	}
 	
 	
Index: tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsPieChartCreator.java
===================================================================
--- tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsPieChartCreator.java	(revision 2752)
+++ tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsPieChartCreator.java	(revision 2753)
@@ -21,12 +21,11 @@
 	
 	
 	@Override
-	public void updateChart(PartitionDimensions result) {
+	public File createChart(PartitionDimensions result, File file) {
 		
 		try {
 			
 			PartitionDimensions partitionDimensions = result;
-			File chart = (File) result.getChart();
 			
 			
 			// parameters
@@ -70,13 +69,15 @@
 			String cmd = String.format("pie(%s, col=colors, labels=%s, horiz=F, las=2, ylab=\"%s\");\n", ssizes, snames, ylab); //$NON-NLS-1$
 			
 			// plot the chart
-			this.getChartsEngine().plot(chart, cmd, result, Utils.createPartitionDimensionsChartTitle(partitionDimensions), Utils.createPartitionDimensionsChartSubtitle(partitionDimensions,
+			this.getChartsEngine().plot(file, cmd, result, Utils.createPartitionDimensionsChartTitle(partitionDimensions), Utils.createPartitionDimensionsChartSubtitle(partitionDimensions,
 					sortPartsBySize, displayPartsCountInTitle));
 			
 		}
 		catch (Exception e) {
 			Log.severe(PartitionCoreMessages.bind(PartitionCoreMessages.cantCreateDimensionsPartitionChartFileChartsEngineColonP0, RChartsEngine.DESCRIPTION) + e);
 		}
+		
+		return file;
 	}
 	
 	
Index: tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsBarChartCreator.java
===================================================================
--- tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsBarChartCreator.java	(revision 2752)
+++ tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsBarChartCreator.java	(revision 2753)
@@ -21,12 +21,11 @@
 
 	
 	@Override
-	public void updateChart(PartitionDimensions result) {
+	public File createChart(PartitionDimensions result, File file) {
 
 		try {
 			
 			PartitionDimensions partitionDimensions = (PartitionDimensions) result;
-			File chart = (File) result.getChart();
 			
 			
 			// parameters
@@ -71,7 +70,7 @@
 			String cmd = String.format("barplot(%s, col=colors, names.arg=%s, horiz=F, las=2, ylab=\"%s\", xlab=\"%s\");\n", ssizes, snames, PartitionCoreMessages.numberOfWords, PartitionCoreMessages.part); //$NON-NLS-1$
 			
 			// plot the chart
-			this.getChartsEngine().plot(chart, cmd, result, Utils.createPartitionDimensionsChartTitle(partitionDimensions), Utils.createPartitionDimensionsChartSubtitle(partitionDimensions, sortPartsBySize, displayPartsCountInTitle));
+			this.getChartsEngine().plot(file, cmd, result, Utils.createPartitionDimensionsChartTitle(partitionDimensions), Utils.createPartitionDimensionsChartSubtitle(partitionDimensions, sortPartsBySize, displayPartsCountInTitle));
 			
 		}
 		catch(Exception e) {
@@ -79,6 +78,7 @@
 			Log.printStackTrace(e);
 		}
 
+		return file;
 	}
 
 	
Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java	(revision 2752)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java	(revision 2753)
@@ -12,11 +12,10 @@
 	
 	
 	@Override
-	public void updateChart(WordCloud result) {
+	public File createChart(WordCloud result, File file) {
 		
 		try {
 			WordCloud wordCloud = result;
-			File chart = (File) result.getChart();
 			
 			
 			// parameters
@@ -67,7 +66,7 @@
 			// System.out.println("ploting...");
 			// rw.plot(svgFile, cmd, device);
 			
-			this.chartsEngine.plot(chart, cmd);
+			this.chartsEngine.plot(file, cmd);
 			
 			
 			// System.out.println("cleaning");
@@ -82,6 +81,8 @@
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
+		
+		return file;
 	}
 	
 	@Override
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGCanvas.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGCanvas.java	(revision 2752)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGCanvas.java	(revision 2753)
@@ -33,6 +33,7 @@
 import java.awt.event.MouseWheelEvent;
 import java.awt.event.MouseWheelListener;
 import java.awt.geom.AffineTransform;
+import java.awt.geom.Dimension2D;
 import java.util.List;
 
 import org.apache.batik.swing.JSVGCanvas;
@@ -361,7 +362,8 @@
 	public void pan(double srcX, double srcY, double dstX, double dstY, double panFactor) {
 		
 		AffineTransform trans = this.getRenderingTransform();
-		trans.translate(-dstX * panFactor, dstY * panFactor);
+		Dimension2D size = this.getSVGDocumentSize(); // adapt the pan to the SVG size
+		trans.translate(-dstX * panFactor * size.getWidth(), dstY * panFactor * size.getHeight());
 		this.setRenderingTransform(trans);
 		
 	}
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGChartComposite.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGChartComposite.java	(revision 2752)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGChartComposite.java	(revision 2753)
@@ -19,7 +19,6 @@
 import org.apache.batik.transcoder.svg2svg.SVGTranscoder;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.txm.chartsengine.core.ChartsEngine;
 import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.chartsengine.rcp.IChartComponent;
@@ -66,44 +65,19 @@
 	
 	@Override
 	public void loadChart(Object chart) {
+		ChartsEngine engine = chartEditor.getChartsEngine();
+		ChartResult result = chartEditor.getResult();
+		int w = this.getSize().x;
+		int h = this.getSize().y;
 		
-		// need to be async (the composite needs to be realized before using its size in export)
-		Display.getDefault().asyncExec(new Runnable() {
-			
-			@Override
-			public void run() {
-				
-				// create the chart file if not of the right type
-				if (!(chart instanceof File)) {
-					ChartResult result = chartEditor.getResult();
-					// result.setChart(null);
-					file = chartEditor.getSWTChartsComponentsProvider().getChartsEngine().getChartCreator(result).createChartFile(result, file, getSize().x, getSize().y);
-					// System.out.println("SVGChartComposite.loadChart() get size: " + chartEditor.getResultArea().getSize());
-					// result.setChart(this.file);
-				}
-				else {
-					file = (File) chart;
-				}
-				
-				
-				loadSVGDocument(file);
-				
-				// ChartsEngine engine = chartEditor.getChartsEngine();
-				// ChartResult result = chartEditor.getResult();
-				// int w = this.getSize().x;
-				// int h = this.getSize().y;
-				// if (w == 0 || h == 0) { // if the composite is not drawn (editor is opening), the chart file size is set to 600*400 by default, TODO resetView() should show-zoom the chart
-				// w = 600;
-				// h = 400;
-				// }
-				// File file = engine.exportChart(result, w, h, ChartsEngine.OUTPUT_FORMAT_SVG);
-				//
-				// this.loadSVGDocument(file);
-				
-				
-			}
-		});
+		// an alternative way is to always call this in a Display.asyncExec() to ensure the widget size is computed -> slow the display
+		if (w == 0 || h == 0) { // if the composite is not drawn (editor is opening), the chart file size is set to 600*400 by default, TODO resetView() should show-zoom the chart
+			w = 600;
+			h = 400;
+		}
+		File file = engine.writeChartResultFile(result, w, h, ChartsEngine.OUTPUT_FORMAT_SVG);
 		
+		this.loadSVGDocument(file);
 	}
 	
 	
@@ -134,7 +108,6 @@
 				
 				try {
 					Log.fine(TXMCoreMessages.bind("Loading SVG document from file: {0}...", file.getAbsolutePath()));
-					Log.finest("SVGChartComposite.loadSVGDocument(...).new Runnable() {...}.run() SVGCanvas size = " + getSVGCanvas().getSize());
 					
 					getSVGCanvas().loadSVGDocument(file.toURL().toExternalForm());
 					
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java	(revision 2752)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java	(revision 2753)
@@ -1,5 +1,7 @@
 package org.txm.progression.core.chartsengine.r;
 
+import java.io.File;
+
 import org.txm.progression.core.functions.Progression;
 
 // FIXME: SJ: this chart creator has been disabled in extension definition to force JFC mode for Cumulative chart and R mode for Density chart since the Density chart is not yet implemented in JFC charts engine  
@@ -13,8 +15,8 @@
 	
 	
 	@Override
-	public void updateChart(Progression result) {
-		super.updateChart(result, true);
+	public File createChart(Progression result, File file) {
+		return super.createChart(result, file, true);
 	}
 	
 }
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 2752)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 2753)
@@ -1,5 +1,7 @@
 package org.txm.progression.core.chartsengine.r;
 
+import java.io.File;
+
 import org.txm.progression.core.functions.Progression;
 
 /**
@@ -12,8 +14,8 @@
 	
 	
 	@Override
-	public void updateChart(Progression result) {
-		super.updateChart(result, false);
+	public File createChart(Progression result, File file) {
+		return super.createChart(result, file, false);
 	}
 	
 	
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java	(revision 2752)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java	(revision 2753)
@@ -37,12 +37,11 @@
 	 * @param cumulative
 	 * @return
 	 */
-	public void updateChart(Progression result, boolean cumulative) {
+	public File createChart(Progression result, File file, boolean cumulative) {
 		
 		try {
 			
 			Progression progression = result;
-			File chart = (File) result.getChart();
 			
 			// boolean cumulative = result.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
 			
@@ -135,7 +134,7 @@
 			String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + cumulative //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 					+ "\",structurepositions,structurenames, \"\", " + progression.getBande() + ");\n";  //$NON-NLS-1$ //$NON-NLS-2$
 			
-			this.getChartsEngine().plot(chart, cmd, result, StringEscapeUtils.escapeJava(Utils.createProgressionChartTitle(progression, cumulative)), null);
+			this.getChartsEngine().plot(file, cmd, result, StringEscapeUtils.escapeJava(Utils.createProgressionChartTitle(progression, cumulative)), null);
 			
 			RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression //$NON-NLS-1$ //$NON-NLS-2$
 					.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)");  //$NON-NLS-1$
@@ -145,6 +144,8 @@
 			// TODO Auto-generated catch block
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
+		
+		return file;
 	}
 	
 	
Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java	(revision 2752)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java	(revision 2753)
@@ -14,11 +14,8 @@
 	
 	
 	@Override
-	public void updateChart(TextsBalance result) {
+	public File createChart(TextsBalance result, File file) {
 		
-		
-		File chart = (File) result.getChart();
-		
 		// try {
 		
 		
@@ -49,7 +46,7 @@
 		
 		
 		// rw.plot(file, cmd, ((RChartsEngine) this.chartsEngine).getRDevice());
-		this.chartsEngine.plot(chart, cmd);
+		this.chartsEngine.plot(file, cmd);
 		
 		// System.out.println("cleaning");
 		// rw.eval("rm(tmplabels)"); //$NON-NLS-1$
@@ -67,6 +64,8 @@
 		// // TODO Auto-generated catch block
 		// e.printStackTrace();
 		// }
+		
+		return file;
 	}
 	
 	@Override
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 2752)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 2753)
@@ -275,10 +275,7 @@
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					bandeField.setEnabled(densityButton.getSelection());
-					// to force the recreation of the chart as file
-					if (!(getResult().getChart() instanceof File)) {
-						getResult().setChart(null);
-					}
+					// This is kind of a hack to change the chart type. See the evolution of the Chart type parameter management
 					getResult().setChartType(Progression.DENSITY_CHART_TYPE);
 					super.widgetSelected(e);
 				}
