afreechart/src/main/java/org/afree/chart/axis/NumberAxis.java
/**
     * Selects an appropriate tick value for the axis. The strategy is to
     * display as many ticks as possible (selected from an array of 'standard'
     * tick units) without the labels overlapping.
     * 
     * @param canvas
     *            the graphics device.
     * @param dataArea
     *            the area defined by the axes.
     * @param edge
     *            the axis location.
     */
Selects an appropriate tick value for the axis. The strategy is to
display as many ticks as possible (selected from an array of 'standard'
tick units) without the labels overlapping.

@param canvas
the graphics device.
@param dataArea
the area defined by the axes.
@param edge
the axis location.
Selects an appropriate tick value for the axis . The strategy is to display as many ticks as possible ( selected from an array of ' standard ' tick units ) without the labels overlapping . @param canvas the graphics device . @param dataArea the area defined by the axes . @param edge the axis location .
protected void selectHorizontalAutoTickUnit(Canvas canvas,
            RectShape dataArea, RectangleEdge edge) {
        double tickLabelWidth = estimateMaximumTickLabelWidth(canvas, getTickUnit());
        TickUnitSource tickUnits = getStandardTickUnits();
        TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
        double unit1Width = lengthToJava2D(unit1.getSize(), dataArea, edge);
        double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
        NumberTickUnit unit2 = (NumberTickUnit) tickUnits
                .getCeilingTickUnit(guess);
        double unit2Width = lengthToJava2D(unit2.getSize(), dataArea, edge);
        tickLabelWidth = estimateMaximumTickLabelWidth(canvas, unit2);
        if (tickLabelWidth > unit2Width) {
            unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
        }
        setTickUnit(unit2, false, false);
    }
protected void selectHorizontalAutoTickUnit ( Canvas canvas , RectShape dataArea , RectangleEdge edge ) { double tickLabelWidth = estimateMaximumTickLabelWidth ( canvas , getTickUnit ( ) ) ; TickUnitSource tickUnits = getStandardTickUnits ( ) ; TickUnit unit1 = tickUnits . getCeilingTickUnit ( getTickUnit ( ) ) ; double unit1Width = lengthToJava2D ( unit1 . getSize ( ) , dataArea , edge ) ; double guess = ( tickLabelWidth / unit1Width ) * unit1 . getSize ( ) ; NumberTickUnit unit2 = ( NumberTickUnit ) tickUnits . getCeilingTickUnit ( guess ) ; double unit2Width = lengthToJava2D ( unit2 . getSize ( ) , dataArea , edge ) ; tickLabelWidth = estimateMaximumTickLabelWidth ( canvas , unit2 ) ; if ( tickLabelWidth > unit2Width ) { unit2 = ( NumberTickUnit ) tickUnits . getLargerTickUnit ( unit2 ) ; } setTickUnit ( unit2 , false , false ) ; }
Selects an appropriate tick value for the axis.
Selects an appropriate tick value for the axis .
// start with the current tick unit... // then extrapolate...