本文整理汇总了Java中org.jfree.data.statistics.BoxAndWhiskerItem类的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerItem类的具体用法?Java BoxAndWhiskerItem怎么用?Java BoxAndWhiskerItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoxAndWhiskerItem类属于org.jfree.data.statistics包,在下文中一共展示了BoxAndWhiskerItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEquals
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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));
}
示例2: testDrawWithNullInfo
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例3: testEquals
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
BoxAndWhiskerItem i1 = 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()
);
BoxAndWhiskerItem i2 = 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()
);
assertTrue(i1.equals(i2));
assertTrue(i2.equals(i1));
}
示例4: testCalculateBoxAndWhiskerStatistics
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的package包/类
/**
* Some checks for the calculateBoxAndWhiskerStatistics() method.
*/
public void testCalculateBoxAndWhiskerStatistics() {
// try null list
boolean pass = false;
try {
BoxAndWhiskerCalculator.calculateBoxAndWhiskerStatistics(null);
}
catch (IllegalArgumentException e) {
pass = true;
}
assertTrue(pass);
// try a list containing a single value
List values = new ArrayList();
values.add(new Double(1.1));
BoxAndWhiskerItem item
= BoxAndWhiskerCalculator.calculateBoxAndWhiskerStatistics(values);
assertEquals(1.1, item.getMean().doubleValue(), EPSILON);
assertEquals(1.1, item.getMedian().doubleValue(), EPSILON);
assertEquals(1.1, item.getQ1().doubleValue(), EPSILON);
assertEquals(1.1, item.getQ3().doubleValue(), EPSILON);
}
示例5: test2909215
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的package包/类
/**
* A test for bug report 2909215.
*/
@Test
public void test2909215() {
DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset(
"Series");
d1.add(new Date(1L), 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), null, null, null));
JFreeChart chart = ChartFactory.createBoxAndWhiskerChart("Title", "X",
"Y", d1, true);
try {
BufferedImage image = new BufferedImage(400, 200,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 400, 200), null, null);
g2.dispose();
}
catch (Exception e) {
fail("No exception should be thrown.");
}
}
示例6: testDrawWithNullInfo
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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.");
}
}
示例7: testDrawWithNullMean
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例8: testDrawWithNullMedian
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例9: testDrawWithNullQ1
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例10: testDrawWithNullQ3
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例11: testDrawWithNullMinRegular
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例12: testDrawWithNullMaxRegular
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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.");
}
}
示例13: testDrawWithNullMinOutlier
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例14: testDrawWithNullMaxOutlier
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的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);
}
示例15: testIterateToFindRangeBounds_BoxAndWhiskerXYDataset
import org.jfree.data.statistics.BoxAndWhiskerItem; //导入依赖的package包/类
/**
* Some checks for the iterateToFindRangeBounds() method when applied to
* a BoxAndWhiskerXYDataset.
*/
@Test
public void testIterateToFindRangeBounds_BoxAndWhiskerXYDataset() {
DefaultBoxAndWhiskerXYDataset dataset
= new DefaultBoxAndWhiskerXYDataset("Series 1");
List visibleSeriesKeys = new ArrayList();
visibleSeriesKeys.add("Series 1");
Range xRange = new Range(Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY);
assertNull(DatasetUtilities.iterateToFindRangeBounds(dataset,
visibleSeriesKeys, xRange, false));
dataset.add(new Date(50L), new BoxAndWhiskerItem(5.0, 4.9, 2.0, 8.0,
1.0, 9.0, 0.0, 10.0, new ArrayList()));
assertEquals(new Range(5.0, 5.0),
DatasetUtilities.iterateToFindRangeBounds(dataset,
visibleSeriesKeys, xRange, false));
assertEquals(new Range(1.0, 9.0),
DatasetUtilities.iterateToFindRangeBounds(dataset,
visibleSeriesKeys, xRange, true));
}