public void updateCrosshairX(double candidateX,int domainAxisIndex){
  double d=Math.abs(candidateX - this.anchorX);
  if (d < this.distance) {
    this.crosshairX=candidateX;
    this.domainAxisIndex=domainAxisIndex;
    this.distance=d;
  }
}

public void updateCrosshairX ( double candidateX , int domainAxisIndex ) { double d = Math . abs ( candidateX - this . anchorX ) ; if ( d < this . distance ) { this . crosshairX = candidateX ; this . domainAxisIndex = domainAxisIndex ; this . distance = d ; } }
evaluates an x - value and if it is the closest to the anchor x - value it becomes the new crosshair value . < p > used in cases where only the x - axis is numerical .
