use of org.activityinfo.shared.report.model.PivotChartReportElement in project activityinfo by bedatadriven.
the class JaxbParseTest method testElements.
@Test
public void testElements() throws JAXBException {
Report report = parseXml("report-elements.xml");
dumpXml(report);
Assert.assertEquals("element count", 7, report.getElements().size());
Assert.assertTrue("pivotTable", report.getElements().get(0) instanceof PivotTableReportElement);
Assert.assertTrue("pivotChart", report.getElements().get(1) instanceof PivotChartReportElement);
Assert.assertTrue("table", report.getElements().get(2) instanceof TableElement);
Assert.assertTrue("map", report.getElements().get(3) instanceof MapReportElement);
Assert.assertTrue("static", report.getElements().get(4) instanceof TextReportElement);
Assert.assertTrue("static", report.getElements().get(5) instanceof TextReportElement);
Assert.assertTrue("static", report.getElements().get(6) instanceof ImageReportElement);
}
use of org.activityinfo.shared.report.model.PivotChartReportElement in project activityinfo by bedatadriven.
the class ItextReportRendererTest method chartTest.
@Test
public void chartTest() throws IOException {
DummyPivotTableData data = new DummyPivotTableData();
PivotChartContent chartContent = new PivotChartContent();
chartContent.setData(data.table);
chartContent.setYMin(0);
chartContent.setYStep(100);
chartContent.setFilterDescriptions(Collections.EMPTY_LIST);
PivotChartReportElement chart = new PivotChartReportElement(Type.Pie);
chart.setTitle("My Pie Chart");
chart.setCategoryDimensions(data.colDims);
chart.setSeriesDimensions(data.rowDims);
chart.setContent(chartContent);
ReportContent content = new ReportContent();
content.setFilterDescriptions(Collections.EMPTY_LIST);
Report report = new Report();
report.setContent(content);
report.addElement(chart);
renderToPdf(report, "chartTest.pdf");
renderToRtf(report, "chartTest.rtf");
}
Aggregations