afreechart/src/main/java/org/afree/chart/axis/PeriodAxis.java
/**
     * Converts a data value to a coordinate in Java2D space, assuming that the
     * axis runs along one edge of the specified dataArea.
     * <p>
     * Note that it is possible for the coordinate to fall outside the area.
     *
     * @param value  the data value.
     * @param area  the area for plotting the data.
     * @param edge  the edge along which the axis lies.
     *
     * @return The Java2D coordinate.
     */
Converts a data value to a coordinate in Java2D space, assuming that the
axis runs along one edge of the specified dataArea.

Note that it is possible for the coordinate to fall outside the area.

@param value  the data value.
@param area  the area for plotting the data.
@param edge  the edge along which the axis lies.

@return The Java2D coordinate.
Converts a data value to a coordinate in Java2D space assuming that the axis runs along one edge of the specified dataArea . Note that it is possible for the coordinate to fall outside the area . @param value the data value . @param area the area for plotting the data . @param edge the edge along which the axis lies . @return The Java2D coordinate .
public double valueToJava2D(double value, RectShape area,
            RectangleEdge edge) {
        double result = Double.NaN;
        double axisMin = this.first.getFirstMillisecond();
        double axisMax = this.last.getLastMillisecond();
        if (RectangleEdge.isTopOrBottom(edge)) {
            double minX = area.getX();
            double maxX = area.getMaxX();
            if (isInverted()) {
                result = maxX + ((value - axisMin) / (axisMax - axisMin))
                         * (minX - maxX);
            }
            else {
                result = minX + ((value - axisMin) / (axisMax - axisMin))
                         * (maxX - minX);
            }
        }
        else if (RectangleEdge.isLeftOrRight(edge)) {
            double minY = area.getMinY();
            double maxY = area.getMaxY();
            if (isInverted()) {
                result = minY + (((value - axisMin) / (axisMax - axisMin))
                         * (maxY - minY));
            }
            else {
                result = maxY - (((value - axisMin) / (axisMax - axisMin))
                         * (maxY - minY));
            }
        }
        return result;
    }
public double valueToJava2D ( double value , RectShape area , RectangleEdge edge ) { double result = Double . NaN ; double axisMin = this . first . getFirstMillisecond ( ) ; double axisMax = this . last . getLastMillisecond ( ) ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { double minX = area . getX ( ) ; double maxX = area . getMaxX ( ) ; if ( isInverted ( ) ) { result = maxX + ( ( value - axisMin ) / ( axisMax - axisMin ) ) * ( minX - maxX ) ; } else { result = minX + ( ( value - axisMin ) / ( axisMax - axisMin ) ) * ( maxX - minX ) ; } } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { double minY = area . getMinY ( ) ; double maxY = area . getMaxY ( ) ; if ( isInverted ( ) ) { result = minY + ( ( ( value - axisMin ) / ( axisMax - axisMin ) ) * ( maxY - minY ) ) ; } else { result = maxY - ( ( ( value - axisMin ) / ( axisMax - axisMin ) ) * ( maxY - minY ) ) ; } } return result ; }
Converts a data value to a coordinate in Java2D space, assuming that the
 axis runs along one edge of the specified dataArea.
Converts a data value to a coordinate in Java2D space assuming that the axis runs along one edge of the specified dataArea .