Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.TickUnits


import org.jfree.chart.axis.TickUnitSource;
import org.jfree.chart.axis.TickUnits;

public class JFreechartUtil {
    public static TickUnitSource create1024IntegerTickUnits() {
        TickUnits units = new TickUnits();
        DecimalFormat df0 = new DecimalFormat("0");
        DecimalFormat df1 = new DecimalFormat("#,##0");
//        units.add(new NumberTickUnit(1, df0, 2));
//        units.add(new NumberTickUnit(2, df0, 2));
//        units.add(new NumberTickUnit(5, df0, 5));
//        units.add(new NumberTickUnit(10, df0, 2));
//        units.add(new NumberTickUnit(20, df0, 2));
//        units.add(new NumberTickUnit(50, df0, 5));
//        units.add(new NumberTickUnit(100, df0, 2));
//        units.add(new NumberTickUnit(200, df0, 2));
//        units.add(new NumberTickUnit(500, df0, 5));
//        units.add(new NumberTickUnit(1000, df1, 2));
//        units.add(new NumberTickUnit(2000, df1, 2));
//        units.add(new NumberTickUnit(5000, df1, 5));
//        units.add(new NumberTickUnit(10000, df1, 2));
//        units.add(new NumberTickUnit(20000, df1, 2));
//        units.add(new NumberTickUnit(50000, df1, 5));
//        units.add(new NumberTickUnit(100000, df1, 2));
//        units.add(new NumberTickUnit(200000, df1, 2));
//        units.add(new NumberTickUnit(500000, df1, 5));
//        units.add(new NumberTickUnit(1000000, df1, 2));
//        units.add(new NumberTickUnit(2000000, df1, 2));
//        units.add(new NumberTickUnit(5000000, df1, 5));
//        units.add(new NumberTickUnit(10000000, df1, 2));
//        units.add(new NumberTickUnit(20000000, df1, 2));
//        units.add(new NumberTickUnit(50000000, df1, 5));
//        units.add(new NumberTickUnit(100000000, df1, 2));
//        units.add(new NumberTickUnit(200000000, df1, 2));
//        units.add(new NumberTickUnit(500000000, df1, 5));
//        units.add(new NumberTickUnit(1000000000, df1, 2));
//        units.add(new NumberTickUnit(2000000000, df1, 2));
//        units.add(new NumberTickUnit(5000000000.0, df1, 5));
//        units.add(new NumberTickUnit(10000000000.0, df1, 2));

        units.add(new NumberTickUnit(1, df0, 2));
        units.add(new NumberTickUnit(2, df0, 2));
        units.add(new NumberTickUnit(4, df0, 2));
        units.add(new NumberTickUnit(8, df0, 2));
        units.add(new NumberTickUnit(16, df0, 2));
        units.add(new NumberTickUnit(32, df0, 2));
        units.add(new NumberTickUnit(64, df0, 2));
        units.add(new NumberTickUnit(128, df0, 2));
        units.add(new NumberTickUnit(256, df0, 2));
        units.add(new NumberTickUnit(512, df0, 2));

        units.add(new NumberTickUnit(1024, df1, 2));
        units.add(new NumberTickUnit(1024 * 2, df1, 2));
        units.add(new NumberTickUnit(1024 * 4, df1, 2));
        units.add(new NumberTickUnit(1024 * 8, df1, 2));
        units.add(new NumberTickUnit(1024 * 16, df1, 2));
        units.add(new NumberTickUnit(1024 * 32, df1, 2));
        units.add(new NumberTickUnit(1024 * 64, df1, 2));
        units.add(new NumberTickUnit(1024 * 128, df1, 2));
        units.add(new NumberTickUnit(1024 * 256, df1, 2));
        units.add(new NumberTickUnit(1024 * 512, df1, 2));

        units.add(new NumberTickUnit(1024 * 1024, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 2, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 4, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 8, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 16, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 32, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 64, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 128, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 256, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 512, df1, 2));

        units.add(new NumberTickUnit(1024 * 1024 * 1024, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 2, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 4, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 8, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 16, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 32, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 64, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 128, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 256, df1, 2));
        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 512, df1, 2));

        units.add(new NumberTickUnit(1024 * 1024 * 1024 * 1024, df1, 2));
        return units;
    }
View Full Code Here


    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = null;
        try {
            t2 = (TickUnits) t1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(t1 != t2);
        assertTrue(t1.getClass() == t2.getClass());
        assertTrue(t1.equals(t2));
    }
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = (TickUnits) NumberAxis.createIntegerTickUnits();
        assertTrue(t1.equals(t2));
        assertTrue(t2.equals(t1));
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = null;
        try {
            t2 = (TickUnits) t1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(t1 != t2);
        assertTrue(t1.getClass() == t2.getClass());
        assertTrue(t1.equals(t2));
    }
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = (TickUnits) NumberAxis.createIntegerTickUnits();
        assertTrue(t1.equals(t2));
        assertTrue(t2.equals(t1));
    }
View Full Code Here

    rangeAxis.setTickLabelPaint(styleXaxesLabels.getColor());
   
    //rangeAxis.setAutoRange(true);
    rangeAxis.setRange(xMin,xMax);

    TickUnits units=null;
    if(decimalXValues==false)
      units=(TickUnits)NumberAxis.createIntegerTickUnits();
    else
      units=(TickUnits)NumberAxis.createStandardTickUnits();
    rangeAxis.setStandardTickUnits(units);

    TickUnits domainUnits=null;
    if(decimalYValues==false)
      domainUnits=(TickUnits)NumberAxis.createIntegerTickUnits();
    else
      domainUnits=(TickUnits)NumberAxis.createStandardTickUnits();
    domainAxis.setStandardTickUnits(domainUnits);
View Full Code Here

   // ---

   static protected TickUnitSource _s_createTickUnits(double dblSizeTickUnit)
   {
     
      TickUnits units = new TickUnits();
      DecimalFormat df7 = new DecimalFormat("0.0");
      DecimalFormat df8 = new DecimalFormat("#,##0");


      // we can add the units in any order, the TickUnits collection will
      // sort them...
      units.add(new NumberTickUnit(dblSizeTickUnit, df7, 2));
      units.add(new NumberTickUnit(1, df8, 2));
      units.add(new NumberTickUnit(10, df8, 2));
      units.add(new NumberTickUnit(100, df8, 2));
      units.add(new NumberTickUnit(1000, df8, 2));

      return units;
   }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
        TickUnits t2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.TickUnits

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.