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


Java PlotOrientation类代码示例

本文整理汇总了Java中org.jfree.chart.plot.PlotOrientation的典型用法代码示例。如果您正苦于以下问题:Java PlotOrientation类的具体用法?Java PlotOrientation怎么用?Java PlotOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
private JFreeChart createChart(XYDataset dataset) {

        JFreeChart chart = ChartFactory.createScatterPlot(this.title,
                this.xAxisLabel, this.yAxisLable, dataset, PlotOrientation.VERTICAL, true, true, false);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setNoDataMessage("NO DATA");
        XYLineAndShapeRenderer renderer
                = (XYLineAndShapeRenderer) plot.getRenderer();
        renderer.setSeriesOutlinePaint(0, Color.black);
        renderer.setUseOutlinePaint(true);

        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
        domainAxis.setAutoRangeIncludesZero(false);
        return chart;

    }
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:18,代码来源:ScatterPlot.java

示例2: XyChartTab

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Instantiates a new XyChartTab.
 * @param model the model
 */
public XyChartTab(XyDataModel model, XyChartEditorJPanel parent){
	super(ChartFactory.createXYLineChart(
			model.getOntologyModel().getChartSettings().getChartTitle(), 
			model.getOntologyModel().getChartSettings().getXAxisLabel(), 
			model.getOntologyModel().getChartSettings().getYAxisLabel(), 
			((XyChartModel)model.getChartModel()).getXySeriesCollection(), 
			PlotOrientation.VERTICAL, 
			true, false, false
	), parent);
	
	this.dataModel = model;
	this.applySettings();
	
	this.dataModel.getChartModel().addObserver(this);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:20,代码来源:XyChartTab.java

示例3: replaceModel

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
@Override
public void replaceModel(DataModel newModel) {
	this.dataModel = newModel;
	
	this.chartPanel.setChart(ChartFactory.createXYLineChart(
			dataModel.getOntologyModel().getChartSettings().getChartTitle(), 
			dataModel.getOntologyModel().getChartSettings().getXAxisLabel(), 
			dataModel.getOntologyModel().getChartSettings().getYAxisLabel(), 
			((XyChartModel)dataModel.getChartModel()).getXySeriesCollection(), 
			PlotOrientation.VERTICAL, 
			true, false, false
	));
	
	this.applySettings();
	
	this.dataModel.getChartModel().addObserver(this);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:18,代码来源:XyChartTab.java

示例4: testFindRangeBounds

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Check that the renderer is calculating the range bounds correctly.
 */
public void testFindRangeBounds() {
    TableXYDataset dataset 
            = RendererXYPackageTests.createTestTableXYDataset();
    JFreeChart chart = ChartFactory.createXYLineChart(
            "Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, 
            false, false, false);
    XYPlot plot = (XYPlot) chart.getPlot();
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setAutoRangeIncludesZero(false);
    Range bounds = rangeAxis.getRange();
    assertFalse(bounds.contains(1.0));
    assertTrue(bounds.contains(2.0));
    assertTrue(bounds.contains(5.0));
    assertFalse(bounds.contains(6.0));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:XYLineAndShapeRendererTests.java

示例5: createCategoryDomainAxis

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
public static CategoryAxis createCategoryDomainAxis(PlotConfiguration plotConfiguration) {
	CategoryAxis domainAxis = new CategoryAxis(null);
	String label = plotConfiguration.getDomainConfigManager().getLabel();
	if (label == null) {
		label = I18N.getGUILabel("plotter.unnamed_value_label");
	}
	domainAxis.setLabel(label);

	Font axesFont = plotConfiguration.getAxesFont();
	if (axesFont != null) {
		domainAxis.setLabelFont(axesFont);
		domainAxis.setTickLabelFont(axesFont);
	}

	// rotate labels
	if (plotConfiguration.getOrientation() != PlotOrientation.HORIZONTAL) {
		domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2.0d));
	}

	formatAxis(plotConfiguration, domainAxis);
	return domainAxis;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:ChartAxisFactory.java

示例6: createBarChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Creates the histogram chart.
 * 
 * @return
 */
private JFreeChart createBarChart() {
	JFreeChart chart = ChartFactory.createBarChart(null, null, null, createBarDataset(), PlotOrientation.VERTICAL,
			false, false, false);
	AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
	chart.setBackgroundPaint(null);
	chart.setBackgroundImageAlpha(0.0f);

	CategoryPlot plot = (CategoryPlot) chart.getPlot();
	plot.setRangeGridlinesVisible(false);
	plot.setDomainGridlinesVisible(false);
	plot.setOutlineVisible(false);
	plot.setRangeZeroBaselineVisible(false);
	plot.setDomainGridlinesVisible(false);
	plot.setBackgroundPaint(COLOR_INVISIBLE);
	plot.setBackgroundImageAlpha(0.0f);

	BarRenderer renderer = (BarRenderer) plot.getRenderer();
	renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NOMINAL));
	renderer.setBarPainter(new StandardBarPainter());
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);

	return chart;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:30,代码来源:NominalAttributeStatisticsModel.java

示例7: createHistogramChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(ExampleSet exampleSet) {
	JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
			PlotOrientation.VERTICAL, false, false, false);
	AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
	chart.setBackgroundPaint(null);
	chart.setBackgroundImageAlpha(0.0f);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setRangeGridlinesVisible(false);
	plot.setDomainGridlinesVisible(false);
	plot.setOutlineVisible(false);
	plot.setRangeZeroBaselineVisible(false);
	plot.setDomainZeroBaselineVisible(false);
	plot.setBackgroundPaint(COLOR_INVISIBLE);
	plot.setBackgroundImageAlpha(0.0f);

	XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
	renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NUMERICAL));
	renderer.setBarPainter(new StandardXYBarPainter());
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);

	return chart;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:31,代码来源:NumericalAttributeStatisticsModel.java

示例8: test1654215

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * A test for bug 1654215 (where a renderer is added to the plot without
 * a corresponding dataset and it throws an exception at drawing time).
 */
public void test1654215() {
    DefaultXYDataset dataset = new DefaultXYDataset();
    JFreeChart chart = ChartFactory.createXYLineChart("Title", "X", "Y",
            dataset, PlotOrientation.VERTICAL, true, false, false);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRenderer(1, new XYLineAndShapeRenderer());
    boolean success = false;
    try {
        BufferedImage image = new BufferedImage(200 , 100, 
                BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
    }
    catch (Exception e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:XYPlotTests.java

示例9: testAutoRange3

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * A simple test for the auto-range calculation looking at a
 * NumberAxis used as the range axis for a CategoryPlot.  In this
 * case, the 'autoRangeIncludesZero' flag is set to false AND the
 * original dataset is replaced with a new dataset.
 */
public void testAutoRange3() {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(100.0, "Row 1", "Column 1");
    dataset.setValue(200.0, "Row 1", "Column 2");
    JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",
            "Value", dataset, PlotOrientation.VERTICAL, false, false,
            false);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    NumberAxis axis = (NumberAxis) plot.getRangeAxis();
    axis.setAutoRangeIncludesZero(false);
    assertEquals(axis.getLowerBound(), 95.0, EPSILON);    
    assertEquals(axis.getUpperBound(), 205.0, EPSILON);    
    
    // now replacing the dataset should update the axis range...
    DefaultCategoryDataset dataset2 = new DefaultCategoryDataset();
    dataset2.setValue(900.0, "Row 1", "Column 1");
    dataset2.setValue(1000.0, "Row 1", "Column 2");
    plot.setDataset(dataset2);
    assertEquals(axis.getLowerBound(), 895.0, EPSILON);    
    assertEquals(axis.getUpperBound(), 1005.0, EPSILON);    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:NumberAxisTests.java

示例10: getChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
@Override
public JFreeChart getChart() throws IOException {

    if (chart == null) {
        final YIntervalSeriesCollection series_collection = getDataset();

        chart = ChartFactory.createXYLineChart(chart_title, "Time through experiment (s)", y_axis_label, series_collection, PlotOrientation.VERTICAL, getDataset().getSeriesCount() > 1, false, false);
        final XYErrorRenderer error_renderer = new XYErrorRenderer();
        error_renderer.setBaseShapesVisible(false);
        error_renderer.setBaseLinesVisible(true);
        error_renderer.setDrawYError(false);
        final XYPlot plot = chart.getXYPlot();
        plot.getRangeAxis().setLowerBound(0);
        plot.setRenderer(error_renderer);
        PlainChartTheme.applyTheme(chart);
    }
    return chart;
}
 
开发者ID:stacs-srg,项目名称:shabdiz,代码行数:19,代码来源:OverlaidGaugeCsvAnalyzer.java

示例11: testDrawWithEmptyDataset

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Test chart drawing with an empty dataset to ensure that this special
 * case doesn't cause any exceptions.
 */
public void testDrawWithEmptyDataset() {
    boolean success = false;
    JFreeChart chart = ChartFactory.createStackedXYAreaChart("title", "x",
            "y", new DefaultTableXYDataset(), PlotOrientation.VERTICAL,
            true, false, false);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRenderer(new StackedXYAreaRenderer2());
    try {
        BufferedImage image = new BufferedImage(200 , 100, 
                BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:StackedXYAreaRenderer2Tests.java

示例12: createChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    XYDataset dataset = new XYSeriesCollection(series1);

    // create the chart...
    return ChartFactory.createScatterPlot(
        "Scatter Plot",  // chart title
        "Domain",
        "Range",
        dataset,         // data
        PlotOrientation.VERTICAL,
        true,            // include legend
        true,            // tooltips
        false            // urls
    );

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:ScatterPlotTests.java

示例13: createChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    XYDataset dataset = new XYSeriesCollection(series1);

    // create the chart...
    return ChartFactory.createXYStepChart(
        "Step Chart",  // chart title
        "Domain",
        "Range",
        dataset,         // data
        PlotOrientation.VERTICAL,
        true,            // include legend
        true,            // tooltips
        true             // urls
    );

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:XYStepChartTests.java

示例14: createChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
/**
     * Creates a sample chart.
     *
     * @param dataset  the dataset.
     *
     * @return The chart.
     */
    private static JFreeChart createChart(CategoryDataset dataset) {
        JFreeChart chart = ChartFactory.createBarChart(
            "Performance: JFreeSVG vs Batik", null /* x-axis label*/, 
                "Milliseconds" /* y-axis label */, dataset, PlotOrientation.HORIZONTAL,false,false,false);
        chart.addSubtitle(new TextTitle("Time to generate 1000 charts in SVG " 
                + "format (lower bars = better performance)"));
        chart.setBackgroundPaint(Color.white);
        CategoryPlot plot = (CategoryPlot) chart.getPlot();

        // ******************************************************************
        //  More than 150 demo applications are included with the JFreeChart
        //  Developer Guide...for more information, see:
        //
        //  >   http://www.object-refinery.com/jfreechart/guide.html
        //
        // ******************************************************************

        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        BarRenderer renderer = (BarRenderer) plot.getRenderer();
        renderer.setDrawBarOutline(false);
//        chart.getLegend().setFrame(BlockBorder.NONE);
        return chart;
    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:32,代码来源:BarChartDemo1.java

示例15: inicializacionJFreeChart

import org.jfree.chart.plot.PlotOrientation; //导入依赖的package包/类
public void inicializacionJFreeChart(String title, String xAxisLabel, String yAxisLabel,
		                             PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) {    	
    chart1 = ChartFactory.createXYLineChart(
    			title,      // chart title Titulo local del grafico
    			xAxisLabel,                      // x axis label
    			yAxisLabel,                      // y axis label
    			null,                  // data
    			orientation,
    			legend,                     // include legend
    			tooltips,                     // tooltips
    			urls                     // urls
            );        
    
    // get a reference to the plot for further customisation...
    plot = chart1.getXYPlot();
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:17,代码来源:VisualizacionJfreechart.java


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