Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.NumberTickUnit


    }

        if (domainAxisTickUnitSize != 0) {
            NumberAxis numberaxis = (NumberAxis)chart.getXYPlot().getDomainAxis();
            numberaxis.setTickLabelFont(new Font(Font.SANS_SERIF,Font.PLAIN,8));
            numberaxis.setTickUnit( new NumberTickUnit(domainAxisTickUnitSize));
        }


    if(rangeAxisIntegerTicks){
      NumberAxis numberaxis = (NumberAxis)chart.getXYPlot().getRangeAxis();  
View Full Code Here


    }

        if (domainAxisTickUnitSize != 0) {
            NumberAxis numberaxis = (NumberAxis)chart.getXYPlot().getDomainAxis();
            numberaxis.setTickLabelFont(new Font(Font.SANS_SERIF,Font.PLAIN,8));
        numberaxis.setTickUnit( new NumberTickUnit(domainAxisTickUnitSize));
        }

    if(rangeAxisIntegerTicks){
      NumberAxis numberaxis = (NumberAxis)chart.getXYPlot().getRangeAxis();
        numberaxis.setAutoRangeIncludesZero(false);
View Full Code Here

        jFreeChart.getXYPlot().setFixedLegendItems(null);
        jFreeChart.getXYPlot().getDomainAxis().setLabelFont(new Font("Tahoma", Font.BOLD, 12));
        ValueAxis yAxis = jFreeChart.getXYPlot().getRangeAxis();
        if (yAxis.getUpperBound() > 1) {
          yAxis.setAutoTickUnitSelection(false);
          NumberTickUnit rUnit = new NumberTickUnit((yAxis.getUpperBound() - yAxis.getLowerBound()) / 5.0);
          ((NumberAxis) yAxis).setTickUnit(rUnit);
        } else {
          yAxis.setAutoTickUnitSelection(false);
          NumberTickUnit rUnit = new NumberTickUnit( 0.1);
          ((NumberAxis) yAxis).setTickUnit(rUnit);
        }
        chartPanel = new ChartPanel(jFreeChart);
        chartPanel.setPreferredSize(new java.awt.Dimension(this.size.width, this.size.height-35));
        basePanel.add(chartPanel);
View Full Code Here

        assertFalse(a1.equals(a2));
        a2.setAutoRangeStickyZero(false);
        assertTrue(a1.equals(a2));

        //private NumberTickUnit tickUnit;
        a1.setTickUnit(new NumberTickUnit(25.0));
        assertFalse(a1.equals(a2));
        a2.setTickUnit(new NumberTickUnit(25.0));
        assertTrue(a1.equals(a2));

        //private NumberFormat numberFormatOverride;
        a1.setNumberFormatOverride(new DecimalFormat("0.00"));
        assertFalse(a1.equals(a2));
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        NumberTickUnit t2 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        assertTrue(t1.equals(t2));
        assertTrue(t2.equals(t1));
       
        t1 = new NumberTickUnit(3.21, new DecimalFormat("0.00"));
        assertFalse(t1.equals(t2));
        t2 = new NumberTickUnit(3.21, new DecimalFormat("0.00"));
        assertTrue(t1.equals(t2));
       
        t1 = new NumberTickUnit(3.21, new DecimalFormat("0.000"));
        assertFalse(t1.equals(t2));
        t2 = new NumberTickUnit(3.21, new DecimalFormat("0.000"));
        assertTrue(t1.equals(t2));
    }
View Full Code Here

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        NumberTickUnit t2 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        int h1 = t1.hashCode();
        int h2 = t2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

    /**
     * This is an immutable class so it doesn't need to be cloneable.
     */
    public void testCloning() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        assertFalse(t1 instanceof Cloneable);
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        NumberTickUnit t2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(t1);
            out.close();
View Full Code Here

TOP

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

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.