public void saveAsPng(final String filename,final int width,final int height){
  try {
    ChartUtilities.saveChartAsPNG(new File(filename),getChart(),width,height,null,true,9);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

public void saveAsPng ( final String filename , final int width , final int height ) { try { ChartUtilities . saveChartAsPNG ( new File ( filename ) , getChart ( ) , width , height , null , true , 9 ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
stores the chart as png image file .
