use of org.activityinfo.legacy.shared.reports.model.PivotChartReportElement in project activityinfo by bedatadriven.
the class ChartTemplate method createElement.
@Override
public void createElement(final AsyncCallback<ReportElement> callback) {
PivotChartReportElement chart = new PivotChartReportElement();
chart.setCategoryDimension(new DateDimension(DateUnit.YEAR));
callback.onSuccess(chart);
}
use of org.activityinfo.legacy.shared.reports.model.PivotChartReportElement in project activityinfo by bedatadriven.
the class EmptyChartsTest method generate.
@Test
public void generate() {
PivotChartReportElement element = new PivotChartReportElement(Type.StackedBar);
element.setIndicator(1);
element.addCategoryDimension(new Dimension(DimensionType.Partner));
element.addSeriesDimension(new Dimension(DimensionType.Database));
DispatcherSync dispatcher = createMock(DispatcherSync.class);
expect(dispatcher.execute(isA(PivotSites.class))).andReturn(new PivotSites.PivotResult(Collections.EMPTY_LIST));
expect(dispatcher.execute(isA(GetDimensionLabels.class))).andReturn(new GetDimensionLabels.DimensionLabels(Collections.EMPTY_MAP));
replay(dispatcher);
IndicatorDAO indicatorDAO = createMock(IndicatorDAO.class);
expect(indicatorDAO.findById(eq(1))).andReturn(new Indicator());
replay(indicatorDAO);
PivotChartGenerator generator = new PivotChartGenerator(dispatcher, indicatorDAO);
generator.generate(new User(), element, new Filter(), new DateRange());
}
Aggregations