code: public Image getChartImage(boolean alpha) {
      // Calculate all unknown dimensions.
      measureComponents();
      updateCoordinates();
  
      // Determine image type based upon whether require alpha or not.
      // Using BufferedImage.TYPE_INT_ARGB seems to break on jpg.
      int imageType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
  
      // Create our chart image which we will eventually draw everything on.
      BufferedImage chartImage = new BufferedImage(chartSize.width, chartSize.height, imageType);
      Graphics2D chartGraphics = chartImage.createGraphics();
  
      // Use anti-aliasing where ever possible.
      chartGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
          RenderingHints.VALUE_ANTIALIAS_ON);
  
      // Set the background.
      chartGraphics.setColor(backgroundColour);
      chartGraphics.fillRect(0, 0, chartSize.width, chartSize.height);
  
      // Draw the title.
      drawTitle(chartGraphics);
  
      // Draw the heatmap image.
      drawHeatMap(chartGraphics, zValues);
  
      // Draw the axis labels.
      drawXLabel(chartGraphics);
      drawYLabel(chartGraphics);
  
      // Draw the axis bars.
      drawAxisBars(chartGraphics);
  
      // Draw axis values.
      drawXValues(chartGraphics);
      drawYValues(chartGraphics);
  
      return chartImage;
    }
docs: Generates and returns a new chart <code>Image</code> configured according to this object's
  currently held settings. The given parameter determines whether transparency should be enabled
  for the generated image.
  
  <p>
  No chart will be generated until this or the related <code>saveToFile(File)</code> method are
  called. All successive calls will result in the generation of a new chart image, no caching is
  used.
  
  @param alpha whether to enable transparency.
  @return A newly generated chart <code>Image</code>. The returned image is a
  <code>BufferedImage</code>.