private BufferedImage getChart(int offsetx, int offsety, int width, int height, int chartWidth, int chartHeight) {
BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB );
Graphics g2 = result.getGraphics();
g2.setColor(Color.white);
g2.fillRect(0, 0, width,height);
g2.translate(offsetx, -offsety);
g2.clipRect(0,offsety,width,height);
myChartModel.setBounds(new Dimension(chartWidth, chartHeight));
paintChart(g2);
//myChartModel.setTuningOptions(ChartModelImpl.TuningOptions.DEFAULT);