use of org.jfree.chart.plot.CategoryPlot in project SIMVA-SoS by SESoS.
the class StatisticalBarRendererTest method testDrawWithNullMeanVertical.
/**
* Draws the chart with a <code>null</code> mean value to make sure that
* no exceptions are thrown (particularly by code in the renderer). See
* bug report 1779941.
*/
@Test
public void testDrawWithNullMeanVertical() {
try {
DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(null, new Double(4.0), "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */
chart.createBufferedImage(300, 200, null);
} catch (NullPointerException e) {
fail("No exception should be thrown.");
}
}
use of org.jfree.chart.plot.CategoryPlot in project SIMVA-SoS by SESoS.
the class StatisticalBarRendererTest method testDrawWithNullDeviationVertical.
/**
* Draws the chart with a <code>null</code> standard deviation to make sure
* that no exceptions are thrown (particularly by code in the renderer).
* See bug report 1779941.
*/
@Test
public void testDrawWithNullDeviationVertical() {
try {
DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(new Double(4.0), null, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */
chart.createBufferedImage(300, 200, null);
} catch (NullPointerException e) {
fail("No exception should be thrown.");
}
}
use of org.jfree.chart.plot.CategoryPlot in project SIMVA-SoS by SESoS.
the class StatisticalBarRendererTest method testDrawWithNullInfo.
/**
* 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 {
DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(3.0, 4.0, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */
chart.createBufferedImage(300, 200, null);
} catch (NullPointerException e) {
fail("No exception should be thrown.");
}
}
use of org.jfree.chart.plot.CategoryPlot in project SIMVA-SoS by SESoS.
the class StatisticalBarRendererTest method testDrawWithNullDeviationHorizontal.
/**
* Draws the chart with a <code>null</code> standard deviation to make sure
* that no exceptions are thrown (particularly by code in the renderer).
* See bug report 1779941.
*/
@Test
public void testDrawWithNullDeviationHorizontal() {
try {
DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(new Double(4.0), null, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new StatisticalBarRenderer());
plot.setOrientation(PlotOrientation.HORIZONTAL);
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */
chart.createBufferedImage(300, 200, null);
} catch (NullPointerException e) {
fail("No exception should be thrown.");
}
}
use of org.jfree.chart.plot.CategoryPlot in project SIMVA-SoS by SESoS.
the class AbstractRendererTest method testFillPaintLookup.
/**
* Some checks for the fill paint lookup mechanism.
*/
@Test
public void testFillPaintLookup() {
BarRenderer r = new BarRenderer();
assertEquals(Color.white, r.getBaseFillPaint());
// first check that autoPopulate==false works as expected
r.setAutoPopulateSeriesFillPaint(false);
assertEquals(Color.white, r.lookupSeriesFillPaint(0));
assertNull(r.getSeriesFillPaint(0));
// now check autoPopulate==true
r.setAutoPopulateSeriesFillPaint(true);
/*CategoryPlot plot =*/
new CategoryPlot(null, new CategoryAxis("Category"), new NumberAxis("Value"), r);
assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0));
assertNotNull(r.getSeriesFillPaint(0));
}
Aggregations