Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.CombinedDomainXYPlot


        XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
        r2.setSeriesLinesVisible(0, false);
        r1.setSeriesShapesVisible(0, true);
        subPlot2.setRenderer(r2);

        CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis(xAxis));
        plot.setGap(10);
        plot.add(subPlot1,1);
        plot.add(subPlot2,1);
        plot.setOrientation(PlotOrientation.VERTICAL);

        final JFreeChart chart = new JFreeChart(title, plot);
        chart.removeLegend();

//        final JFreeChart chart = ChartFactory.createXYLineChart(
View Full Code Here


        for (XYAnnotation a : plot.getAnnotations()) {
            applyToXYAnnotation(a);
        }

        if (plot instanceof CombinedDomainXYPlot) {
            CombinedDomainXYPlot cp = (CombinedDomainXYPlot) plot;
            for (XYPlot subplot : cp.getSubplots()) {
                if (subplot != null) {
                    applyToPlot(subplot);
                }
            }
        }
        if (plot instanceof CombinedRangeXYPlot) {
            CombinedRangeXYPlot cp = (CombinedRangeXYPlot) plot;
            for (XYPlot subplot : cp.getSubplots()) {
                if (subplot != null) {
                    applyToPlot(subplot);
                }
            }
        }
View Full Code Here

    colors.push(SERIE2_COLOR);
    colors.push(SERIE3_COLOR);
  }

  protected BufferedImage getChartImage() throws IOException {
    CombinedDomainXYPlot combinedPlot = new CombinedDomainXYPlot();
    combinedPlot.setGap(10);
    combinedPlot.setOrientation(PlotOrientation.VERTICAL);
    DateAxis dateAxis = new DateAxis();
    combinedPlot.setDomainAxis(dateAxis);
    dateAxis.setTickLabelPaint(BASE_COLOR);
    for(String legend: legends) {
      CombinedHistoryPlot plot = plotsPerLegend.get(legend);
      Double min = minsPerPlotLegend.get(plot.metricName);
      Double max = maxsPerPlotLegend.get(plot.metricName);
      plot.configureRangeAxisForGivenType(min, max);
      combinedPlot.add(plot.getPlot());
    }

    JFreeChart chart = new JFreeChart(null, TextTitle.DEFAULT_FONT, combinedPlot, true);
    configureChart(chart, true);
    return super.getBufferedImage(chart);
View Full Code Here

    /**
     * Confirm that the constructor will accept a null axis.
     */
    public void testConstructor1() {
        CombinedDomainXYPlot plot = new CombinedDomainXYPlot(null);
        assertEquals(null, plot.getDomainAxis());
    }
View Full Code Here

   
    /**
     * This is a test to replicate the bug report 987080.
     */
    public void testRemoveSubplot() {
        CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
        XYPlot plot1 = new XYPlot();
        XYPlot plot2 = new XYPlot();
        plot.add(plot1);
        plot.add(plot2);
        // remove plot2, but plot1 is removed instead
        plot.remove(plot2);
        List plots = plot.getSubplots();
        assertTrue(plots.get(0) == plot1);
    }
View Full Code Here

   
    /**
     * Tests the equals() method.
     */
    public void testEquals() {
        CombinedDomainXYPlot plot1 = createPlot();
        CombinedDomainXYPlot plot2 = createPlot();
        assertTrue(plot1.equals(plot2));   
        assertTrue(plot2.equals(plot1));
    }
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        CombinedDomainXYPlot plot1 = createPlot();       
        CombinedDomainXYPlot plot2 = null;
        try {
            plot2 = (CombinedDomainXYPlot) plot1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(plot1 != plot2);
        assertTrue(plot1.getClass() == plot2.getClass());
        assertTrue(plot1.equals(plot2));
    }
View Full Code Here

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

        CombinedDomainXYPlot plot1 = createPlot();
        CombinedDomainXYPlot plot2 = null;

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

        rangeAxis2.setAutoRangeIncludesZero(false);
        XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
        subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

        // parent plot...
        CombinedDomainXYPlot plot
            = new CombinedDomainXYPlot(new NumberAxis("Domain"));
        plot.setGap(10.0);
       
        // add the subplots...
        plot.add(subplot1, 1);
        plot.add(subplot2, 1);
        plot.setOrientation(PlotOrientation.VERTICAL);
        return plot;
    }
View Full Code Here

public class JFreeCharts implements IJFreeCharts {
   
    @Override
    public Plot getCombinedXYPlot(XYSeries[] series, String groupPostfix) {
        CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
        plot.setGap(20.0);
        plot.setOrientation(PlotOrientation.VERTICAL);

        XYItemRenderer renderer;
        NumberAxis rangeAxisY;
        XYPlot xyPlot;

        for (int i = 0; i < series.length; i++) {
            renderer = new StandardXYItemRenderer();
            rangeAxisY = getNumberAxis();
            rangeAxisY.setLabel((i + 1) + groupPostfix);
            xyPlot = new XYPlot(new XYSeriesCollection(series[i]), null, rangeAxisY, renderer);
            xyPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
            plot.add(xyPlot);
        }
        return plot;
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.plot.CombinedDomainXYPlot

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.