private void drawLine(Graphics2D g2,Line2D line,double x0,double y0,double x1,double y1,Rectangle2D dataArea){
  if (Double.isNaN(x0) || Double.isNaN(x1) || Double.isNaN(y0)|| Double.isNaN(y1)) {
    return;
  }
  line.setLine(x0,y0,x1,y1);
  boolean visible=LineUtilities.clipLine(line,dataArea);
  if (visible) {
    g2.draw(line);
  }
}

private void drawLine ( Graphics2D g2 , Line2D line , double x0 , double y0 , double x1 , double y1 , Rectangle2D dataArea ) { if ( Double . isNaN ( x0 ) || Double . isNaN ( x1 ) || Double . isNaN ( y0 ) || Double . isNaN ( y1 ) ) { return ; } line . setLine ( x0 , y0 , x1 , y1 ) ; boolean visible = LineUtilities . clipLine ( line , dataArea ) ; if ( visible ) { g2 . draw ( line ) ; } }
a utility method that draws a line but only if none of the coordinates are nan values .
