当前位置: 首页>>代码示例>>Java>>正文


Java CombinedDomainXYPlot.setOrientation方法代码示例

本文整理汇总了Java中org.jfree.chart.plot.CombinedDomainXYPlot.setOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java CombinedDomainXYPlot.setOrientation方法的具体用法?Java CombinedDomainXYPlot.setOrientation怎么用?Java CombinedDomainXYPlot.setOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.plot.CombinedDomainXYPlot的用法示例。


在下文中一共展示了CombinedDomainXYPlot.setOrientation方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createGeneralChartPanel

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
public ChartPanel createGeneralChartPanel() {
	CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Generations"));
	plot.setGap(10.0);
	
	for (int i = 0; i < this.gCtrl.getNumOfSelectedObjectives(); i++) {
		XYPlot subp = this.createSubplot(i);
		this.subplots.add(subp);
		plot.add(subp);
	}
       plot.setOrientation(PlotOrientation.VERTICAL);
       
       LegendItemCollection chartLegend = new LegendItemCollection();
       chartLegend.add(new LegendItem("Population range", null, null, null, new Rectangle(10, 10), blue));
       chartLegend.add(new LegendItem("Generation average", null, null, null, new Rectangle(10, 1), stroke1, blue1));
       chartLegend.add(new LegendItem("Absolute best", null, null, null, new Rectangle(10, 1), stroke2, blue2));
       plot.setFixedLegendItems(chartLegend);
	
	return new ChartPanel(new JFreeChart("", plot));
}
 
开发者ID:hecoding,项目名称:Pac-Man,代码行数:20,代码来源:CenterPanel.java

示例2: createPlot

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a sample plot.
 * 
 * @return A sample plot.
 */
private CombinedDomainXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    
    XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);
    
    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:CombinedDomainXYPlotTests.java

示例3: createPlot

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a sample plot.
 * 
 * @return A sample plot.
 */
private CombinedDomainXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    
    XYTextAnnotation annotation 
        = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);
    
    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:CombinedDomainXYPlotTests.java

示例4: createCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a combined chart.
 *
 * @return the combined chart.
 */
private static JFreeChart createCombinedChart() {

    // create subplot 1...
    final XYDataset data1 = createDataset1();
    final XYItemRenderer renderer1 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis( "Range 1" );
    final XYPlot subplot1 = new XYPlot( data1, null, rangeAxis1, renderer1 );
    subplot1.setRangeAxisLocation( AxisLocation.BOTTOM_OR_LEFT );

    final XYTextAnnotation annotation = new XYTextAnnotation( "Hello!", 50.0, 10000.0 );
    annotation.setFont( new Font( "SansSerif", Font.PLAIN, 9 ) );
    annotation.setRotationAngle( Math.PI / 4.0 );
    subplot1.addAnnotation( annotation );

    // create subplot 2...
    final XYDataset data2 = createDataset2();
    final XYItemRenderer renderer2 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis2 = new NumberAxis( "Range 2" );
    rangeAxis2.setAutoRangeIncludesZero( false );
    final XYPlot subplot2 = new XYPlot( data2, null, rangeAxis2, renderer2 );
    subplot2.setRangeAxisLocation( AxisLocation.TOP_OR_LEFT );

    // parent plot...
    final 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 a new chart containing the overlaid plot...
    return new JFreeChart( "CombinedDomainXYPlot Demo",
                           JFreeChart.DEFAULT_TITLE_FONT, plot, true );

}
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:CombinedXYPlotDemo1.java

示例5: BSCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Sole constructor.
 */
public BSCombinedChart() {
    super( null, null, new CombinedDomainXYPlot(), CREATE_LEGEND );
    
    // Energy plot...
    { 
        _energyPlot = new BSEnergyPlot();
        _energyPlot.setDomainAxis( null );
    }
    
    // Wave Function plot...
    {
        _bottomPlot = new BSBottomPlot();
        _bottomPlot.setDomainAxis( null );
    }

    // Common X axis...
    BSPositionAxis positionAxis = new BSPositionAxis();
    
    // Parent plot configuration...
    {
        CombinedDomainXYPlot plot = (CombinedDomainXYPlot) getPlot();
        
        // Misc properties
        plot.setDomainAxis( positionAxis );
        plot.setGap( CHART_SPACING );
        plot.setOrientation( PlotOrientation.VERTICAL );

        // Add the subplots, energy plot is twice the size of wave function plot.
        plot.add( _energyPlot, 2 );
        plot.add( _bottomPlot, 1 );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:36,代码来源:BSCombinedChart.java

示例6: createCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
private static JFreeChart createCombinedChart() {

        // create subplot 1...
        final XYItemRenderer renderer1 = new StandardXYItemRenderer();
        final NumberAxis rangeAxis1 = new NumberAxis( "Range 1" );
        final XYPlot subplot1 = new XYPlot( createDataset1(), null, rangeAxis1, renderer1 );
        subplot1.setRangeAxisLocation( AxisLocation.BOTTOM_OR_LEFT );

        final XYTextAnnotation annotation = new XYTextAnnotation( "Hello!", 50.0, 10000.0 );
        annotation.setFont( new Font( "SansSerif", Font.PLAIN, 9 ) );
        annotation.setRotationAngle( Math.PI / 4.0 );
        subplot1.addAnnotation( annotation );

        // create subplot 2...
        final XYItemRenderer renderer2 = new StandardXYItemRenderer();
        final NumberAxis rangeAxis2 = new NumberAxis( "Range 2" );
        rangeAxis2.setAutoRangeIncludesZero( false );
        final XYPlot subplot2 = new XYPlot( createDataset2(), null, rangeAxis2, renderer2 );
        subplot2.setRangeAxisLocation( AxisLocation.TOP_OR_LEFT );

        // parent plot...
        final 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 a new chart containing the overlaid plot...
        return new JFreeChart( "CombinedDomainXYPlot Demo",
                               JFreeChart.DEFAULT_TITLE_FONT, plot, true );

    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:35,代码来源:TestCombinedChartNode.java

示例7: createCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a combined chart.
 *
 * @return The combined chart.
 */
private JFreeChart createCombinedChart(DataSequence tsOne, DataSequence tsTwo, ArrayList<Anomaly> anomalyList) {

    // create subplot 1.
    final XYDataset data1 = createDataset(tsOne, "Original");
    final XYItemRenderer renderer1 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis("Original Value");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    
    // plot anomalies on subplot 1.
    addAnomalies(subplot1, anomalyList);
    
    // create subplot 2.
    final XYDataset data2 = createDataset(tsTwo, "Forecast");
    final XYItemRenderer renderer2 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis2 = new NumberAxis("Forecast Value");
    rangeAxis2.setAutoRangeIncludesZero(false);
    final XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

    // parent plot.
    final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Time"));
    plot.setGap(10.0);
    
    // add the subplots.
    plot.add(subplot1, 1);
    plot.add(subplot2, 1);
    
    // Add anomaly score time-series.
    addAnomalyTS(plot, tsOne, tsTwo);
    
    plot.setOrientation(PlotOrientation.VERTICAL);

    // return a new chart containing the overlaid plot.
    return new JFreeChart("EGADS GUI",
                          JFreeChart.DEFAULT_TITLE_FONT,
                          plot,
                          true);
}
 
开发者ID:yahoo,项目名称:egads,代码行数:45,代码来源:GUIUtils.java

示例8: createPlot

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a sample plot.
 *
 * @return A sample plot.
 */
private CombinedDomainXYPlot createPlot() {
    // create subplot 1...
    XYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new StandardXYItemRenderer();
    NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    XYTextAnnotation annotation
        = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);

    // create subplot 2...
    XYDataset data2 = createDataset2();
    XYItemRenderer renderer2 = new StandardXYItemRenderer();
    NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:39,代码来源:CombinedDomainXYPlotTests.java

示例9: createCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a combined chart.
 *
 * @return the combined chart.
 */
private JFreeChart createCombinedChart() {

    // create subplot 1...
    final XYDataset data1 = createDataset1();
    final XYItemRenderer renderer1 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    final XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    final XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);

    // create subplot 2...
    final XYDataset data2 = createDataset2();
    final XYItemRenderer renderer2 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    final XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

    // parent plot...
    final 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 a new chart containing the overlaid plot...
    return new JFreeChart("CombinedDomainXYPlot Demo",
                          JFreeChart.DEFAULT_TITLE_FONT, plot, true);

}
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:42,代码来源:CombinedXYPlotDemo1.java

示例10: createChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
private JFreeChart createChart() {

      final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new DateAxis("Time"));
      final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
      final ClusteredXYBarRenderer barRenderer = new ClusteredXYBarRenderer();
      final GradientPaint black = new GradientPaint(0.0f, 0.0f, Color.black, 0.0f, 0.0f, Color.black);

      final TimeSeries seriests = new TimeSeries("Series");
      final TimeSeries seasonalts = new TimeSeries("Seasonal");
      final TimeSeries trendts = new TimeSeries("Trend");
      final TimeSeries remainderts = new TimeSeries("Remainder");

      final TimeSeries[] tsArray = new TimeSeries[]{seriests, seasonalts, trendts};
      final String[] labels = new String[]{"Series", "Seasonal", "Trend"};

      for (int i = 0; i < series.length; i++) {
        final Date d = new Date((long) times[i]);
        RegularTimePeriod rtp = RegularTimePeriod.createInstance(this.timePeriod, d, TimeZone.getDefault());
        seriests.addOrUpdate(rtp, series[i]);
        seasonalts.addOrUpdate(rtp, seasonal[i]);
        trendts.addOrUpdate(rtp, trend[i]);
        remainderts.addOrUpdate(rtp, remainder[i]);
      }

      plot.setGap(10.0);
      renderer.setSeriesPaint(0, black);
      barRenderer.setSeriesPaint(0, black);
      plot.setOrientation(PlotOrientation.VERTICAL);

      for (int i = 0; i < tsArray.length; i++) {
        final XYDataset ts = new TimeSeriesCollection(tsArray[i]);
        final XYPlot p = new XYPlot(ts, new DateAxis(labels[i]), new NumberAxis(labels[i]), renderer);
        plot.add(p);
      }

      final XYDataset rts = new TimeSeriesCollection(remainderts);
      final XYDataset sts = new TimeSeriesCollection(seriests);
      final XYDataset tts = new TimeSeriesCollection(trendts);
      final XYPlot rplot = new XYPlot(rts, new DateAxis(), new NumberAxis("Remainder"), barRenderer);
      final XYPlot seriesAndTrend = new XYPlot(sts, new DateAxis(), new NumberAxis("S & T"), renderer);

      seriesAndTrend.setDataset(1, tts);
      seriesAndTrend.setRenderer(1, renderer);

      plot.add(rplot);
      plot.add(seriesAndTrend);

      return new JFreeChart(this.title, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    }
 
开发者ID:ruananswer,项目名称:twitter-anomalyDetection-java,代码行数:50,代码来源:StlPlotter.java

示例11: createChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
private JFreeChart createChart() {

            final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new DateAxis("Time"));
            final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
            final ClusteredXYBarRenderer barRenderer = new ClusteredXYBarRenderer();
            final GradientPaint black = new GradientPaint(0.0f, 0.0f, Color.black, 0.0f, 0.0f, Color.black);

            final TimeSeries seriests = new TimeSeries("Series");
            final TimeSeries seasonalts = new TimeSeries("Seasonal");
            final TimeSeries trendts = new TimeSeries("Trend");
            final TimeSeries remainderts = new TimeSeries("Remainder");

            final TimeSeries[] tsArray = new TimeSeries[]{seriests, seasonalts, trendts};
            final String[] labels = new String[]{"Series", "Seasonal", "Trend"};

            for (int i = 0; i < series.length; i++) {
                final Date d = new Date((long) times[i]);
                RegularTimePeriod rtp = RegularTimePeriod.createInstance(this.timePeriod, d, TimeZone.getDefault());
                seriests.addOrUpdate(rtp, series[i]);
                seasonalts.addOrUpdate(rtp, seasonal[i]);
                trendts.addOrUpdate(rtp, trend[i]);
                remainderts.addOrUpdate(rtp, remainder[i]);
            }

            plot.setGap(10.0);
            renderer.setSeriesPaint(0, black);
            barRenderer.setSeriesPaint(0, black);
            plot.setOrientation(PlotOrientation.VERTICAL);

            for (int i = 0; i < tsArray.length; i++) {
                final XYDataset ts = new TimeSeriesCollection(tsArray[i]);
                final XYPlot p = new XYPlot(ts, new DateAxis(labels[i]), new NumberAxis(labels[i]), renderer);
                plot.add(p);
            }

            final XYDataset rts = new TimeSeriesCollection(remainderts);
            final XYDataset sts = new TimeSeriesCollection(seriests);
            final XYDataset tts = new TimeSeriesCollection(trendts);
            final XYPlot rplot = new XYPlot(rts, new DateAxis(), new NumberAxis("Remainder"), barRenderer);
            final XYPlot seriesAndTrend = new XYPlot(sts, new DateAxis(), new NumberAxis("S & T"), renderer);

            seriesAndTrend.setDataset(1, tts);
            seriesAndTrend.setRenderer(1, renderer);

            plot.add(rplot);
            plot.add(seriesAndTrend);

            return new JFreeChart(this.title, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
        }
 
开发者ID:kevoree,项目名称:kevoree-brain,代码行数:50,代码来源:StlPlotter.java

示例12: createCombinedChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * Creates a combined chart.
 *
 * @return The combined chart.
 */
private JFreeChart createCombinedChart() {

    // create subplot 1...
    final XYDataset data1 = createDataset1();
    final XYItemRenderer renderer1 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis1 = new NumberAxis("Range 1");
    final XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
    subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    // add secondary axis
    subplot1.setDataset(1, createDataset2());
    final NumberAxis axis2 = new NumberAxis("Range Axis 2");
    axis2.setAutoRangeIncludesZero(false);
    subplot1.setRangeAxis(1, axis2);
    subplot1.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
    subplot1.setRenderer(1, new StandardXYItemRenderer());
    subplot1.mapDatasetToRangeAxis(1, 1);

    final XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0);
    annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));
    annotation.setRotationAngle(Math.PI / 4.0);
    subplot1.addAnnotation(annotation);

    // create subplot 2...
    final XYDataset data2 = createDataset2();
    final XYItemRenderer renderer2 = new StandardXYItemRenderer();
    final NumberAxis rangeAxis2 = new NumberAxis("Range 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    final XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
    subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

    // parent plot...
    final 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 a new chart containing the overlaid plot...
    return new JFreeChart("CombinedDomainXYPlot Demo",
                          JFreeChart.DEFAULT_TITLE_FONT, plot, true);

}
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:51,代码来源:CombinedXYPlotDemo4.java

示例13: addVerticalSectionChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
public static JFreeChart addVerticalSectionChart(JFreeChart transectChart,
        JFreeChart verticalSectionChart) {
    /*
     * Create the combined chart with both the transect and the vertical
     * section
     */
    CombinedDomainXYPlot plot = new CombinedDomainXYPlot(
            new NumberAxis("Distance along path (km)"));
    plot.setGap(20.0);
    plot.add(transectChart.getXYPlot(), 1);
    plot.add(verticalSectionChart.getXYPlot(), 1);
    plot.setOrientation(PlotOrientation.VERTICAL);
    String title = transectChart.getTitle().getText();
    String copyright = null;
    for (int i = 0; i < transectChart.getSubtitleCount(); i++) {
        Title subtitle = transectChart.getSubtitle(i);
        if (subtitle instanceof TextTitle) {
            copyright = ((TextTitle) transectChart.getSubtitle(0)).getText();
            break;
        }
    }

    JFreeChart combinedChart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot,
            false);

    /* Set left margin to 10 to avoid number wrap at color bar */
    RectangleInsets r = new RectangleInsets(0, 10, 0, 0);
    transectChart.setPadding(r);

    /*
     * This is not ideal. We have already added the copyright label to the
     * first chart, but then we extract the actual plot, so we need to add
     * it again here
     */
    if (copyright != null) {
        final TextTitle textTitle = new TextTitle(copyright);
        textTitle.setFont(new Font("SansSerif", Font.PLAIN, 10));
        textTitle.setPosition(RectangleEdge.BOTTOM);
        textTitle.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        combinedChart.addSubtitle(textTitle);
    }

    /* Use the legend from the vertical section chart */
    combinedChart.addSubtitle(verticalSectionChart.getSubtitle(0));

    return combinedChart;
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:48,代码来源:Charting.java

示例14: createHistogramChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
private JFreeChart createHistogramChart() {

    XYBarRenderer renderer1 = new XYBarRenderer();
    renderer1.setSeriesPaint(0, Color.cyan);
    renderer1.setSeriesPaint(1, Color.pink);

    XYPlot histPlot = new XYPlot(histogramDataset, null, new NumberAxis("count"), renderer1);

    XYBarRenderer renderer2 = new XYBarRenderer();
    renderer2.setSeriesPaint(0, Color.green);
    renderer2.setSeriesPaint(1, Color.orange);
    renderer2.setUseYInterval(true);

    // weight and potential
    if (infoParser.isRobustBoost || infoParser.isAdaBoost || infoParser.isLogLossBoost) {
      StandardXYItemRenderer renderer3 = new StandardXYItemRenderer();
      renderer3.setSeriesPaint(0, Color.blue);
      renderer3.setSeriesPaint(1, Color.red);
      renderer3.setBaseStroke(new BasicStroke(2));

      StandardXYItemRenderer renderer4 = new StandardXYItemRenderer();
      renderer4.setSeriesPaint(0, Color.blue);
      renderer4.setSeriesPaint(1, Color.red);
      renderer4.setBaseStroke(new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 2, new float[] { 2 }, 0));

      histPlot.setDataset(1, weightDataset);
      histPlot.setRenderer(1, renderer3);

      histPlot.setDataset(2, potentialDataset);
      histPlot.setRenderer(2, renderer4);

      histPlot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
    }

    XYPlot fluctPlot = new XYPlot(fluctDataset, null, new NumberAxis("bin"), renderer2);

    double initialLocation = (upper_limit + lower_limit) / 2.0;
    histMarker = new IntervalMarker(initialLocation, initialLocation);
    histPlot.addDomainMarker(histMarker, Layer.BACKGROUND);
    fluctPlot.addDomainMarker(histMarker, Layer.BACKGROUND);

    // plot.setBackgroundPaint(Color.lightGray);
    // plot.setDomainGridlinePaint(Color.white);
    // plot.setRangeGridlinePaint(Color.white);

    CombinedDomainXYPlot combinedPlot = new CombinedDomainXYPlot(new NumberAxis("score"));
    combinedPlot.setGap(10.0);

    // add the subplots...
    ValueAxis axis = new NumberAxis();
    axis.setRange(rawData.getMinRange(iter), rawData.getMaxRange(iter));
    combinedPlot.add(histPlot, 3);
    combinedPlot.add(fluctPlot, 1);
    combinedPlot.setOrientation(PlotOrientation.VERTICAL);
    combinedPlot.setDomainAxis(axis);

    JFreeChart chart = new JFreeChart("Histogram", JFreeChart.DEFAULT_TITLE_FONT, combinedPlot, false // legend
        );

    return chart;
  }
 
开发者ID:sunsern,项目名称:jboost,代码行数:62,代码来源:HistogramFrame.java


注:本文中的org.jfree.chart.plot.CombinedDomainXYPlot.setOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。