code: void closePath(
        Graphics2D g, Path2D.Double path, double previousX, Rectangle2D bounds, double yTopMargin) {
  
      if (path != null) {
        double yBottomOfArea = getBounds().getY() + getBounds().getHeight() - yTopMargin;
        path.lineTo(previousX, yBottomOfArea);
        path.closePath();
        g.fill(path);
      }
    }
docs: Closes a path for area charts if one is available.