use of org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset in project ES-LEI-2Sem-2022-Grupo-1 by tmrbo-iscte.
the class XYBoxAndWhiskerRendererTest method test2909215.
/**
* A test for bug report 2909215.
*/
@Test
public void test2909215() {
DefaultBoxAndWhiskerXYDataset<String> d1 = new DefaultBoxAndWhiskerXYDataset<>("Series");
d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 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.");
}
}
use of org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset in project ES-LEI-2Sem-2022-Grupo-1 by tmrbo-iscte.
the class DatasetUtilsTest method testIterateToFindRangeBounds_BoxAndWhiskerXYDataset.
/**
* Some checks for the iterateToFindRangeBounds() method when applied to
* a BoxAndWhiskerXYDataset.
*/
@Test
public void testIterateToFindRangeBounds_BoxAndWhiskerXYDataset() {
DefaultBoxAndWhiskerXYDataset<String> dataset = new DefaultBoxAndWhiskerXYDataset<>("Series 1");
List<String> 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));
}
use of org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testIterateToFindRangeBounds_BoxAndWhiskerXYDataset.
/**
* 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));
}
use of org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset in project SIMVA-SoS by SESoS.
the class XYBoxAndWhiskerRendererTest method test2909215.
/**
* 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.");
}
}
Aggregations