afreechart/src/main/java/org/afree/chart/plot/CategoryCrosshairState.java
/**
     * Evaluates a data point from a {@link CategoryItemRenderer} and if it is
     * the closest to the anchor point it becomes the new crosshair point.
     * 
     * @param rowKey
     *            the row key.
     * @param columnKey
     *            the column key.
     * @param value
     *            y coordinate (measured against the range axis).
     * @param datasetIndex
     *            the dataset index for this point.
     * @param transX
     *            x translated into Java2D space.
     * @param transY
     *            y translated into Java2D space.
     * @param orientation
     *            the plot orientation.
     */
Evaluates a data point from a  CategoryItemRenderer and if it is
the closest to the anchor point it becomes the new crosshair point.

@param rowKey
the row key.
@param columnKey
the column key.
@param value
y coordinate (measured against the range axis).
@param datasetIndex
the dataset index for this point.
@param transX
x translated into Java2D space.
@param transY
y translated into Java2D space.
@param orientation
the plot orientation.
Evaluates a data point from a CategoryItemRenderer and if it is the closest to the anchor point it becomes the new crosshair point . @param rowKey the row key . @param columnKey the column key . @param value y coordinate ( measured against the range axis ) . @param datasetIndex the dataset index for this point . @param transX x translated into Java2D space . @param transY y translated into Java2D space . @param orientation the plot orientation .
public void updateCrosshairPoint(Comparable rowKey, Comparable columnKey,
            double value, int datasetIndex, double transX, double transY,
            PlotOrientation orientation) {
        PointF anchor = getAnchor();
        if (anchor != null) {
            double xx = anchor.x;
            double yy = anchor.y;
            if (orientation == PlotOrientation.HORIZONTAL) {
                double temp = yy;
                yy = xx;
                xx = temp;
            }
            double d = (transX - xx) * (transX - xx) + (transY - yy)
                    * (transY - yy);
            if (d < getCrosshairDistance()) {
                this.rowKey = rowKey;
                this.columnKey = columnKey;
                setCrosshairY(value);
                setDatasetIndex(datasetIndex);
                setCrosshairDistance(d);
            }
        }
    }
public void updateCrosshairPoint ( Comparable rowKey , Comparable columnKey , double value , int datasetIndex , double transX , double transY , PlotOrientation orientation ) { PointF anchor = getAnchor ( ) ; if ( anchor != null ) { double xx = anchor . x ; double yy = anchor . y ; if ( orientation == PlotOrientation . HORIZONTAL ) { double temp = yy ; yy = xx ; xx = temp ; } double d = ( transX - xx ) * ( transX - xx ) + ( transY - yy ) * ( transY - yy ) ; if ( d < getCrosshairDistance ( ) ) { this . rowKey = rowKey ; this . columnKey = columnKey ; setCrosshairY ( value ) ; setDatasetIndex ( datasetIndex ) ; setCrosshairDistance ( d ) ; } } }
Evaluates a data point from a {@link CategoryItemRenderer} and if it is
 the closest to the anchor point it becomes the new crosshair point.
Evaluates a data point from a { @link CategoryItemRenderer } and if it is the closest to the anchor point it becomes the new crosshair point .