afreechart/src/main/java/org/afree/chart/axis/DateAxis.java
/**
     * Translates a Java2D coordinate into the corresponding data value.  To
     * perform this translation, you need to know the area used for plotting
     * data, and which edge the axis is located on.
     *
     * @param java2DValue  the coordinate in Java2D space.
     * @param area  the RectShape (in Java2D space) where the data is to be
     *              plotted.
     * @param edge  the axis location.
     *
     * @return A data value.
     */
Translates a Java2D coordinate into the corresponding data value.  To
perform this translation, you need to know the area used for plotting
data, and which edge the axis is located on.

@param java2DValue  the coordinate in Java2D space.
@param area  the RectShape (in Java2D space) where the data is to be
plotted.
@param edge  the axis location.

@return A data value.
Translates a Java2D coordinate into the corresponding data value . To perform this translation you need to know the area used for plotting data and which edge the axis is located on . @param java2DValue the coordinate in Java2D space . @param area the RectShape ( in Java2D space ) where the data is to be plotted . @param edge the axis location . @return A data value .
public double java2DToValue(double java2DValue, RectShape area,
                                RectangleEdge edge) {
        DateRange range = (DateRange) getRange();
        double axisMin = this.timeline.toTimelineValue(range.getLowerMillis());
        double axisMax = this.timeline.toTimelineValue(range.getUpperMillis());
        double min = 0.0;
        double max = 0.0;
        if (RectangleEdge.isTopOrBottom(edge)) {
            min = area.getX();
            max = area.getMaxX();
        }
        else if (RectangleEdge.isLeftOrRight(edge)) {
            min = area.getMaxY();
            max = area.getY();
        }
        double result;
        if (isInverted()) {
             result = axisMax - ((java2DValue - min) / (max - min)
                      * (axisMax - axisMin));
        }
        else {
             result = axisMin + ((java2DValue - min) / (max - min)
                      * (axisMax - axisMin));
        }
        return this.timeline.toMillisecond((long) result);
    }
public double java2DToValue ( double java2DValue , RectShape area , RectangleEdge edge ) { DateRange range = ( DateRange ) getRange ( ) ; double axisMin = this . timeline . toTimelineValue ( range . getLowerMillis ( ) ) ; double axisMax = this . timeline . toTimelineValue ( range . getUpperMillis ( ) ) ; double min = 0.0 ; double max = 0.0 ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { min = area . getX ( ) ; max = area . getMaxX ( ) ; } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { min = area . getMaxY ( ) ; max = area . getY ( ) ; } double result ; if ( isInverted ( ) ) { result = axisMax - ( ( java2DValue - min ) / ( max - min ) * ( axisMax - axisMin ) ) ; } else { result = axisMin + ( ( java2DValue - min ) / ( max - min ) * ( axisMax - axisMin ) ) ; } return this . timeline . toMillisecond ( ( long ) result ) ; }
Translates a Java2D coordinate into the corresponding data value.
Translates a Java2D coordinate into the corresponding data value .