Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.NumberTickUnit


    /**
     * 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


        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

      horizontalAxis.setLowerMargin(-0.5d / (categorySet.getColumnCount() + (graphType != null && graphType.equals("area") ? -1 : 1)));
      horizontalAxis.setUpperMargin(-0.5d / (categorySet.getColumnCount() + (graphType != null && graphType.equals("area") ? -1 : 1)));
     
      NumberAxis verticalAxis = (NumberAxis)plot.getRangeAxis();
      verticalAxis.setNumberFormatOverride(NumberFormat.getIntegerInstance());
      verticalAxis.setTickUnit(new NumberTickUnit(maxValue % 30 == 0 ? maxValue / 30 : maxValue / 30 + 1));
      verticalAxis.setLowerMargin(0);
      verticalAxis.setUpperMargin(0);
    }
     
    String fileId = "";
View Full Code Here

        this.datasets = new HashMap<Integer, Dataset>();
        this.datasets.put(0, dataset);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
        this.angleTickUnit = new NumberTickUnit(DEFAULT_ANGLE_TICK_UNIT_SIZE);

        this.axes = new HashMap<Integer, ValueAxis>();
        this.datasetToAxesMap = new TreeMap<Integer, List<Integer>>();
        this.axes.put(0, radiusAxis);
        if (radiusAxis != null) {
View Full Code Here

    @Override
    public void updatePlotProperties(Plot plot) {
        super.updatePlotProperties(plot);
        PolarPlot pp = (PolarPlot) plot;
        pp.setAngleTickUnit(new NumberTickUnit(this.manualTickUnitValue));
        pp.setAngleOffset(this.angleOffsetValue);
    }
View Full Code Here

    @Override
    public void setAxisProperties(Axis axis) {
        super.setAxisProperties(axis);
        NumberAxis numberAxis = (NumberAxis) axis;
        if (!isAutoTickUnitSelection()) {
            numberAxis.setTickUnit(new NumberTickUnit(manualTickUnitValue));
        }
    }
View Full Code Here

    @Override
    public void setAxisProperties(Axis axis) {
        super.setAxisProperties(axis);
        LogAxis logAxis = (LogAxis) axis;
        if (!isAutoTickUnitSelection()) {
            logAxis.setTickUnit(new NumberTickUnit(manualTickUnitValue));
        }
    }
View Full Code Here

        axis.setNumberFormatOverride(new HudsonBuildFormat());
        axis.setAutoRange(true);
        axis.setAutoRangeIncludesZero(false);
        axis.setLowerMargin(0.0);
        axis.setUpperMargin(0.0);
        axis.setTickUnit(new NumberTickUnit(1.0));

        chart.getXYPlot().setDomainAxis(axis);
        return chart;
    }
View Full Code Here

        plot1.setAngleGridlineStroke(s);
        assertFalse(plot1.equals(plot2));
        plot2.setAngleGridlineStroke(s);
        assertEquals(plot1, plot2);

        plot1.setAngleTickUnit(new NumberTickUnit(11.0));
        assertFalse(plot1.equals(plot2));
        plot2.setAngleTickUnit(new NumberTickUnit(11.0));
        assertEquals(plot1, plot2);

        plot1.setAngleGridlinesVisible(false);
        assertFalse(plot1.equals(plot2));
        plot2.setAngleGridlinesVisible(false);
View Full Code Here

      numberAxis.setAutoRangeIncludesZero(false);
      numberAxis.setLabelPaint(BASE_COLOR);
      numberAxis.setTickLabelPaint(BASE_COLOR);

      if (metricType == MetricType.PERCENTAGE) {
        numberAxis.setTickUnit(new NumberTickUnit(25, new DecimalFormat("0'%'")));
        numberAxis.setUpperBound(105.0);
      } else if (metricType == MetricType.DURATION_MS) {
        numberAxis.setNumberFormatOverride(new
            DecimalFormat("0' ms'"));
      }
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.