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


Java DefaultBoxAndWhiskerCategoryDataset类代码示例

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


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

示例1: writeRankVSScore

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
public static void writeRankVSScore(File outputFile, List<SimilarityMatrix> matrices, int length, String add) throws Exception{		
	final DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset();
	for(SimilarityMatrix m:matrices){
		int[][] sortedIndizes=m.getIndizesOfSortedScores();
		List<Double>[] scoreList=new List[Math.min(length,sortedIndizes[0].length)];
		for(int i=0;i<scoreList.length;i++)scoreList[i]=new ArrayList<Double>();
		for(int i=0;i<sortedIndizes.length;i++){
			int l=0;
			for(int j=0;j<sortedIndizes[i].length;j++){
				double v=m.getSimilarityValue(i,sortedIndizes[i][j]);
				if(!Double.isNaN(v)){
					scoreList[l].add(v);
					l++;						
				}
				if(l>=scoreList.length)break;
			}			
		}
		for(int i=0;i<scoreList.length;i++)
			dataset.add(scoreList[i], m.getMethodsQueryAndDBString(), i);

	}

	JFreeChart chart=ChartFactory.createBoxAndWhiskerChart("Whiskerplot", "Ranks", "Scores", dataset, true);
	ChartUtilities.saveChartAsJPEG(new File(outputFile.getPath()+sep+add+"RankVSScore_"+getMethodsQueryStringFromList(matrices)+".jpg"), chart, Math.min(2000,length*100), 1000);
}
 
开发者ID:boecker-lab,项目名称:passatuto,代码行数:26,代码来源:SimilarityMatrix.java

示例2: testEquals

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    final DefaultBoxAndWhiskerCategoryDataset d1 = new DefaultBoxAndWhiskerCategoryDataset();
    d1.add(
        new BoxAndWhiskerItem(
            new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0),
            new Double(5.0), new Double(6.0), new Double(7.0), new Double(8.0),
            new ArrayList()
        ), "ROW1", "COLUMN1"
    );
    final DefaultBoxAndWhiskerCategoryDataset d2 = new DefaultBoxAndWhiskerCategoryDataset();
    d2.add(
        new BoxAndWhiskerItem(
            new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0),
            new Double(5.0), new Double(6.0), new Double(7.0), new Double(8.0),
            new ArrayList()
        ), "ROW1", "COLUMN1"
    );
    assertTrue(d1.equals(d2));
    assertTrue(d2.equals(d1));

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

示例3: testDrawWithNullInfo

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的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.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的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).
 */
@Test
public void testDrawWithNullInfo() {
    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);
    }
    catch (NullPointerException e) {
        fail("No exception should be thrown.");
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:BoxAndWhiskerRendererTest.java

示例5: testGetLegendItem

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Some checks for the getLegendItem() method.
 */
@Test
public void testGetLegendItem() {
    DefaultBoxAndWhiskerCategoryDataset dataset
            = new DefaultBoxAndWhiskerCategoryDataset();
    List values = new ArrayList();
    values.add(new Double(1.10));
    values.add(new Double(1.45));
    values.add(new Double(1.33));
    values.add(new Double(1.23));
    dataset.add(values, "R1", "C1");
    BoxAndWhiskerRenderer r = new BoxAndWhiskerRenderer();
    CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("x"),
            new NumberAxis("y"), r);
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(0, 0);
    assertNotNull(li);
    r.setSeriesVisibleInLegend(0, Boolean.FALSE);
    li = r.getLegendItem(0, 0);
    assertNull(li);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:BoxAndWhiskerRendererTest.java

示例6: testDrawWithNullMean

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null mean value.
 */
@Test
public void testDrawWithNullMean() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(null, 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());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例7: testDrawWithNullMedian

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null median value.
 */
@Test
public void testDrawWithNullMedian() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), null,
                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());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例8: testDrawWithNullQ1

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null Q1 value.
 */
@Test
public void testDrawWithNullQ1() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                null, 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());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例9: testDrawWithNullQ3

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null Q3 value.
 */
@Test
public void testDrawWithNullQ3() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(3.0), null, 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());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例10: testDrawWithNullMinRegular

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null min regular value.
 */
@Test
public void testDrawWithNullMinRegular() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(3.0), new Double(4.0), null,
                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());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例11: testDrawWithNullMaxRegular

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null max regular value.
 */
@Test
public void testDrawWithNullMaxRegular() {
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(3.0), new Double(4.0), new Double(0.5),
                null, new Double(-0.5), new Double(5.5),
                null), "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                new BoxAndWhiskerRenderer());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
    }
    catch (Exception e) {
        fail("No exception should be thrown.");
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:BoxAndWhiskerRendererTest.java

示例12: testDrawWithNullMinOutlier

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null min outlier value.
 */
@Test
public void testDrawWithNullMinOutlier() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(3.0), new Double(4.0), new Double(0.5),
                new Double(4.5), null, new Double(5.5),
                null), "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                new BoxAndWhiskerRenderer());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例13: testDrawWithNullMaxOutlier

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws a chart where the dataset contains a null max outlier value.
 */
@Test
public void testDrawWithNullMaxOutlier() {
    boolean success;
    try {
        DefaultBoxAndWhiskerCategoryDataset dataset
                = new DefaultBoxAndWhiskerCategoryDataset();
        dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
                new Double(3.0), new Double(4.0), new Double(0.5),
                new Double(4.5), new Double(-0.5), null,
                new java.util.ArrayList()), "S1", "C1");
        CategoryPlot plot = new CategoryPlot(dataset,
                new CategoryAxis("Category"), new NumberAxis("Value"),
                new BoxAndWhiskerRenderer());
        ChartRenderingInfo info = new ChartRenderingInfo();
        JFreeChart chart = new JFreeChart(plot);
        /* BufferedImage image = */ chart.createBufferedImage(300, 200,
                info);
        success = true;
    }
    catch (Exception e) {
        success = false;
    }
    assertTrue(success);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例14: testDrawWithNullInfo

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
 * Draws the chart with a {@code null} info object to make sure that
 * no exceptions are thrown (particularly by code in the renderer).
 */
@Test
public void testDrawWithNullInfo() {
    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);
    }
    catch (NullPointerException e) {
        fail("No exception should be thrown.");
    }
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:25,代码来源:BoxAndWhiskerRendererTest.java

示例15: createBoxAndWhiskerDataset

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入依赖的package包/类
private BoxAndWhiskerCategoryDataset createBoxAndWhiskerDataset(int seriesCount, int categoryCount, String[] seriesName, String[][] categoryName, double[][][] values ){

		List<Double> list;

        DefaultBoxAndWhiskerCategoryDataset result 
            = new DefaultBoxAndWhiskerCategoryDataset();

        for (int s = 0; s <seriesCount; s++) {
            for (int c = 0; c <categoryCount; c++) {
				list = new java.util.ArrayList<Double>();
				for (int i=0; i<Array.getLength(values[s][c]);i++)
					list.add(new Double(values[s][c][i]));
                result.add(list, seriesName[s], categoryName[s][c]);
            }
        }
        return result;

	}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:19,代码来源:ChartGenerator.java


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