afreechart/src/main/java/org/afree/chart/axis/NumberAxis.java
/**
     * Creates a collection of standard tick units. The supplied locale is used
     * to create the number formatter (a localised instance of
     * <code>NumberFormat</code>).
     * <P>
     * If you don't like these defaults, create your own instance of
     * {@link TickUnits} and then pass it to the
     * <code>setStandardTickUnits()</code> method.
     * 
     * @param locale
     *            the locale.
     * 
     * @return A tick unit collection.
     * 
     * @see #setStandardTickUnits(TickUnitSource)
     */
Creates a collection of standard tick units. The supplied locale is used
to create the number formatter (a localised instance of
NumberFormat).

If you don't like these defaults, create your own instance of
TickUnits and then pass it to the
setStandardTickUnits() method.

@param locale
the locale.

@return A tick unit collection.


Creates a collection of standard tick units . The supplied locale is used to create the number formatter ( a localised instance of NumberFormat ) . If you don ' t like these defaults create your own instance of TickUnits and then pass it to the setStandardTickUnits () method . @param locale the locale . @return A tick unit collection .
public static TickUnitSource createStandardTickUnits(Locale locale) {
        TickUnits units = new TickUnits();
        NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
        units.add(new NumberTickUnit(0.0000001, numberFormat, 2));
        units.add(new NumberTickUnit(0.000001, numberFormat, 2));
        units.add(new NumberTickUnit(0.00001, numberFormat, 2));
        units.add(new NumberTickUnit(0.0001, numberFormat, 2));
        units.add(new NumberTickUnit(0.001, numberFormat, 2));
        units.add(new NumberTickUnit(0.01, numberFormat, 2));
        units.add(new NumberTickUnit(0.1, numberFormat, 2));
        units.add(new NumberTickUnit(1, numberFormat, 2));
        units.add(new NumberTickUnit(10, numberFormat, 2));
        units.add(new NumberTickUnit(100, numberFormat, 2));
        units.add(new NumberTickUnit(1000, numberFormat, 2));
        units.add(new NumberTickUnit(10000, numberFormat, 2));
        units.add(new NumberTickUnit(100000, numberFormat, 2));
        units.add(new NumberTickUnit(1000000, numberFormat, 2));
        units.add(new NumberTickUnit(10000000, numberFormat, 2));
        units.add(new NumberTickUnit(100000000, numberFormat, 2));
        units.add(new NumberTickUnit(1000000000, numberFormat, 2));
        units.add(new NumberTickUnit(10000000000.0, numberFormat, 2));
        units.add(new NumberTickUnit(0.00000025, numberFormat, 5));
        units.add(new NumberTickUnit(0.0000025, numberFormat, 5));
        units.add(new NumberTickUnit(0.000025, numberFormat, 5));
        units.add(new NumberTickUnit(0.00025, numberFormat, 5));
        units.add(new NumberTickUnit(0.0025, numberFormat, 5));
        units.add(new NumberTickUnit(0.025, numberFormat, 5));
        units.add(new NumberTickUnit(0.25, numberFormat, 5));
        units.add(new NumberTickUnit(2.5, numberFormat, 5));
        units.add(new NumberTickUnit(25, numberFormat, 5));
        units.add(new NumberTickUnit(250, numberFormat, 5));
        units.add(new NumberTickUnit(2500, numberFormat, 5));
        units.add(new NumberTickUnit(25000, numberFormat, 5));
        units.add(new NumberTickUnit(250000, numberFormat, 5));
        units.add(new NumberTickUnit(2500000, numberFormat, 5));
        units.add(new NumberTickUnit(25000000, numberFormat, 5));
        units.add(new NumberTickUnit(250000000, numberFormat, 5));
        units.add(new NumberTickUnit(2500000000.0, numberFormat, 5));
        units.add(new NumberTickUnit(25000000000.0, numberFormat, 5));
        units.add(new NumberTickUnit(0.0000005, numberFormat, 5));
        units.add(new NumberTickUnit(0.000005, numberFormat, 5));
        units.add(new NumberTickUnit(0.00005, numberFormat, 5));
        units.add(new NumberTickUnit(0.0005, numberFormat, 5));
        units.add(new NumberTickUnit(0.005, numberFormat, 5));
        units.add(new NumberTickUnit(0.05, numberFormat, 5));
        units.add(new NumberTickUnit(0.5, numberFormat, 5));
        units.add(new NumberTickUnit(5L, numberFormat, 5));
        units.add(new NumberTickUnit(50L, numberFormat, 5));
        units.add(new NumberTickUnit(500L, numberFormat, 5));
        units.add(new NumberTickUnit(5000L, numberFormat, 5));
        units.add(new NumberTickUnit(50000L, numberFormat, 5));
        units.add(new NumberTickUnit(500000L, numberFormat, 5));
        units.add(new NumberTickUnit(5000000L, numberFormat, 5));
        units.add(new NumberTickUnit(50000000L, numberFormat, 5));
        units.add(new NumberTickUnit(500000000L, numberFormat, 5));
        units.add(new NumberTickUnit(5000000000L, numberFormat, 5));
        units.add(new NumberTickUnit(50000000000L, numberFormat, 5));
        return units;
    }
public static TickUnitSource createStandardTickUnits ( Locale locale ) { TickUnits units = new TickUnits ( ) ; NumberFormat numberFormat = NumberFormat . getNumberInstance ( locale ) ; units . add ( new NumberTickUnit ( 0.0000001 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.000001 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.00001 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.0001 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.001 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.01 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.1 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 1 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 10 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 100 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 1000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 10000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 100000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 1000000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 10000000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 100000000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 1000000000 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 10000000000.0 , numberFormat , 2 ) ) ; units . add ( new NumberTickUnit ( 0.00000025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.0000025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.000025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.00025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.0025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.025 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.25 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 2.5 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 25 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 250 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 2500 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 25000 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 250000 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 2500000 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 25000000 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 250000000 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 2500000000.0 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 25000000000.0 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.0000005 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.000005 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.00005 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.0005 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.005 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.05 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 0.5 , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 5L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 50L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 500L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 5000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 50000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 500000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 5000000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 50000000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 500000000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 5000000000L , numberFormat , 5 ) ) ; units . add ( new NumberTickUnit ( 50000000000L , numberFormat , 5 ) ) ; return units ; }
Creates a collection of standard tick units.
Creates a collection of standard tick units .
// we can add the units in any order, the TickUnits collection will // sort them...