本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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.");
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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.");
}
}
示例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);
}
示例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);
}
示例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.");
}
}
示例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;
}