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


Java JFreeChart.createBufferedImage方法代码示例

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


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

示例1: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(1.0, "S1", "C1");
        dataset.addValue(2.0, "S1", "C2");
        dataset.addValue(3.0, "S2", "C1");
        dataset.addValue(4.0, "S2", "C2");
        GroupedStackedBarRenderer renderer 
            = new GroupedStackedBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:GroupedStackedBarRendererTests.java

示例2: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(1.0, "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new LevelRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:LevelRendererTests.java

示例3: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset 
            = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(0.0), new Double(4.0), new Double(0.5), 
                new Double(4.5), new Double(-0.5), new Double(5.5), 
                null), "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new BoxAndWhiskerRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:BoxAndWhiskerRendererTests.java

示例4: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultStatisticalCategoryDataset dataset 
            = new DefaultStatisticalCategoryDataset();
        dataset.add(1.0, 2.0, "S1", "C1");
        dataset.add(3.0, 4.0, "S1", "C2");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new StatisticalLineAndShapeRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:StatisticalLineAndShapeRendererTests.java

示例5: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultStatisticalCategoryDataset dataset 
            = new DefaultStatisticalCategoryDataset();
        dataset.add(1.0, 2.0, "S1", "C1");
        dataset.add(3.0, 4.0, "S1", "C2");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new StatisticalBarRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:StatisticalBarRendererTests.java

示例6: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        double[][] starts = new double[][] {{0.1, 0.2, 0.3}, 
                {0.3, 0.4, 0.5}};
        double[][] ends = new double[][] {{0.5, 0.6, 0.7}, {0.7, 0.8, 0.9}};
        DefaultIntervalCategoryDataset dataset 
            = new DefaultIntervalCategoryDataset(starts, ends);        
        IntervalBarRenderer renderer = new IntervalBarRenderer();
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:IntervalBarRendererTests.java

示例7: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(1.0, "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new MinMaxCategoryRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:MinMaxCategoryRendererTests.java

示例8: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(1.0, "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset, 
                new CategoryAxis("Category"), new NumberAxis("Value"), 
                new LayeredBarRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:LayeredBarRendererTests.java

示例9: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown.
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        float[][] data = createData();

        ValueAxis domainAxis = new NumberAxis("X");
        ValueAxis rangeAxis = new NumberAxis("Y");
        FastScatterPlot plot = new FastScatterPlot(data, domainAxis, 
                rangeAxis);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:FastScatterPlotTests.java

示例10: testDrawWithNullInfo2

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (a problem that was occurring at one point).
 */
public void testDrawWithNullInfo2() {
    boolean success = false;
    try {
        JFreeChart chart = createGanttChart();
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        plot.setDataset(createDataset());
        /* BufferedImage img =*/ chart.createBufferedImage(300, 200, null);
        success = true;
    }
    catch (NullPointerException e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:GanttChartTests.java

示例11: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                new XYStepRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:XYStepRendererTests.java

示例12: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                new XYAreaRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:XYAreaRendererTests.java

示例13: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                new StackedXYAreaRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:StackedXYAreaRendererTests.java

示例14: testBug1593156

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * A test for bug 1593156.
 */
public void testBug1593156() {
    boolean success = false;
    try {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        StackedXYAreaRenderer renderer = new StackedXYAreaRenderer(
                XYAreaRenderer.LINES);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                renderer);
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:StackedXYAreaRendererTests.java

示例15: testDrawWithNullInfo

import org.jfree.chart.JFreeChart; //导入方法依赖的package包/类
/**
 * Draws the chart with a <code>null</code> info object to make sure that 
 * no exceptions are thrown (particularly by code in the renderer).
 */
public void testDrawWithNullInfo() {
    boolean success = false;
    try {
        DefaultTableXYDataset dataset = new DefaultTableXYDataset();
    
        XYSeries s1 = new XYSeries("Series 1", true, false);
        s1.add(5.0, 5.0);
        s1.add(10.0, 15.5);
        s1.add(15.0, 9.5);
        s1.add(20.0, 7.5);
        dataset.addSeries(s1);
    
        XYSeries s2 = new XYSeries("Series 2", true, false);
        s2.add(5.0, 5.0);
        s2.add(10.0, 15.5);
        s2.add(15.0, 9.5);
        s2.add(20.0, 3.5);
        dataset.addSeries(s2);
        XYPlot plot = new XYPlot(dataset, 
                new NumberAxis("X"), new NumberAxis("Y"), 
                new XYStepAreaRenderer());
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200, 
                null);
        success = true;
    }
    catch (NullPointerException e) {
        e.printStackTrace();
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:XYStepAreaRendererTests.java


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