本文整理汇总了Java中org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset.add方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultBoxAndWhiskerXYDataset.add方法的具体用法?Java DefaultBoxAndWhiskerXYDataset.add怎么用?Java DefaultBoxAndWhiskerXYDataset.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset
的用法示例。
在下文中一共展示了DefaultBoxAndWhiskerXYDataset.add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test2909215
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的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.");
}
}
示例2: testIterateToFindRangeBounds_BoxAndWhiskerXYDataset
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的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));
}
示例3: testIterateToFindRangeBounds_BoxAndWhiskerXYDataset
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的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(DatasetUtils.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),
DatasetUtils.iterateToFindRangeBounds(dataset,
visibleSeriesKeys, xRange, false));
assertEquals(new Range(1.0, 9.0),
DatasetUtils.iterateToFindRangeBounds(dataset,
visibleSeriesKeys, xRange, true));
}
示例4: testIterateToFindRangeBounds_BoxAndWhiskerXYDataset
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的package包/类
/**
* Some checks for the iterateToFindRangeBounds() method when applied to
* a BoxAndWhiskerXYDataset.
*/
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));
}
示例5: testAdd
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的package包/类
/**
* Some checks for the add() method.
*/
public void testAdd() {
DefaultBoxAndWhiskerXYDataset dataset
= new DefaultBoxAndWhiskerXYDataset("S1");
BoxAndWhiskerItem item1 = new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0, new ArrayList());
dataset.add(new Date(33L), item1);
assertEquals(1.0, dataset.getY(0, 0).doubleValue(), EPSILON);
assertEquals(1.0, dataset.getMeanValue(0, 0).doubleValue(), EPSILON);
assertEquals(2.0, dataset.getMedianValue(0, 0).doubleValue(), EPSILON);
assertEquals(3.0, dataset.getQ1Value(0, 0).doubleValue(), EPSILON);
assertEquals(4.0, dataset.getQ3Value(0, 0).doubleValue(), EPSILON);
assertEquals(5.0, dataset.getMinRegularValue(0, 0).doubleValue(),
EPSILON);
assertEquals(6.0, dataset.getMaxRegularValue(0, 0).doubleValue(),
EPSILON);
assertEquals(7.0, dataset.getMinOutlier(0, 0).doubleValue(), EPSILON);
assertEquals(8.0, dataset.getMaxOutlier(0, 0).doubleValue(), EPSILON);
assertEquals(new Range(5.0, 6.0), dataset.getRangeBounds(false));
}
示例6: testGetRangeBounds
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的package包/类
/**
* Some checks for the getRangeBounds() method.
*/
public void testGetRangeBounds() {
DefaultBoxAndWhiskerXYDataset d1
= new DefaultBoxAndWhiskerXYDataset("S");
d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0,
6.0, 7.0, 8.0, new ArrayList()));
assertEquals(new Range(5.0, 6.0), d1.getRangeBounds(false));
assertEquals(new Range(5.0, 6.0), d1.getRangeBounds(true));
d1.add(new Date(1L), new BoxAndWhiskerItem(1.5, 2.5, 3.5, 4.5, 5.5,
6.5, 7.5, 8.5, new ArrayList()));
assertEquals(new Range(5.0, 6.5), d1.getRangeBounds(false));
assertEquals(new Range(5.0, 6.5), d1.getRangeBounds(true));
d1.add(new Date(2L), new BoxAndWhiskerItem(2.5, 3.5, 4.5, 5.5, 6.5,
7.5, 8.5, 9.5, new ArrayList()));
assertEquals(new Range(5.0, 7.5), d1.getRangeBounds(false));
assertEquals(new Range(5.0, 7.5), d1.getRangeBounds(true));
}
示例7: testEquals
import org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset; //导入方法依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset(
"Series");
DefaultBoxAndWhiskerXYDataset d2 = new DefaultBoxAndWhiskerXYDataset(
"Series");
assertTrue(d1.equals(d2));
d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0,
6.0, 7.0, 8.0, new ArrayList()));
assertFalse(d1.equals(d2));
d2.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0,
6.0, 7.0, 8.0, new ArrayList()));
assertTrue(d1.equals(d2));
}