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


Java DefaultBoxAndWhiskerCategoryDataset.add方法代码示例

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


在下文中一共展示了DefaultBoxAndWhiskerCategoryDataset.add方法的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: 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:jfree,项目名称:jfreechart,代码行数:25,代码来源:BoxAndWhiskerRendererTest.java

示例6: 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

示例7: 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:nick-paul,项目名称:aya-lang,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例8: 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:jfree,项目名称:jfreechart,代码行数:28,代码来源:BoxAndWhiskerRendererTest.java

示例9: 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

示例10: 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

示例11: 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

示例12: 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:nick-paul,项目名称:aya-lang,代码行数:24,代码来源:BoxAndWhiskerRendererTest.java

示例13: 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

示例14: createDataset2

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
protected BoxAndWhiskerCategoryDataset createDataset2(boolean isDemo) {
	if (isDemo){
        SERIES_COUNT = 1;
        CATEGORY_COUNT = 1;
        VALUE_COUNT = 20;
        values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
   

        DefaultBoxAndWhiskerCategoryDataset result 
            = new DefaultBoxAndWhiskerCategoryDataset();
        List values = createValueList("3, -2, 4, 4, 5, 6, 6, 7, 1, 1, 1, 2,3, 4, 3, 4, 3, 10, 7, 6");
        
        result.add(values, "" , "" );
        
        values_storage[0][0]="3, -2, 4, 4, 5, 6, 6, 7, 1, 1, 1, 2,3, 4, 3, 4, 3, 10, 7, 6";
       
        return result;}
		else return super.createDataset2(false);
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:20,代码来源:DotChart.java

示例15: createDataset

import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
/**
   * Returns a sample dataset.
   * 
   * @return The dataset.
   */
  protected BoxAndWhiskerCategoryDataset createDataset(boolean isDemo) {
if (isDemo){
      SERIES_COUNT = 3;
      CATEGORY_COUNT = 2;
      VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
 

      DefaultBoxAndWhiskerCategoryDataset result 
          = new DefaultBoxAndWhiskerCategoryDataset();

      for (int s = 0; s < SERIES_COUNT; s++) {
          for (int c = 0; c < CATEGORY_COUNT; c++) {
              List values = createValueList(0, 20.0, VALUE_COUNT);
		values_storage[s][c]= vs;
              result.add(values, "Series " + s, "Category " + c);
          }
      }
      return result;}
else return super.createDataset(false);
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:27,代码来源:BoxAndWhiskerChartDemo1.java


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