code: private void drawTitle(Graphics2D chartGraphics) {
      if (title != null) {
        // Strings are drawn from the baseline position of the leftmost char.
        int yTitle = (margin / 2) + titleAscent;
        int xTitle = (chartSize.width / 2) - (titleSize.width / 2);
  
        chartGraphics.setFont(titleFont);
        chartGraphics.setColor(titleColour);
        chartGraphics.drawString(title, xTitle, yTitle);
      }
    }
docs: /*
  Draws the title String on the chart if title is not null.