public void createPngFile(double x, double y, double scale, int size, String fileName)
     throws IOException {
   bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
   graphics2d = bi.createGraphics();
   super.drawDataSet(x, y, scale, size);
   ImageIO.write(bi, "PNG", new File(fileName));
 }
 public void createPngLegend(int width, int height, String fileName) throws IOException {
   bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
   graphics2d = bi.createGraphics();
   super.drawLegend(width, height);
   ImageIO.write(bi, "PNG", new File(fileName));
 }