JFreeChartEngine.saveChart( widget, dialTitle, units, filePathWithoutExtension, width, height,
JFreeChartEngine.OUTPUT_PNG, printWriter, this );
// Create a document that describes the result
Document result = DocumentHelper.createDocument();
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Element root = result.addElement( "widget" ); //$NON-NLS-1$
root.addElement( "title" ).setText( title ); //$NON-NLS-1$
root.addElement( "units" ).setText( units ); //$NON-NLS-1$
root.addElement( "width" ).setText( Integer.toString( width ) ); //$NON-NLS-1$