Search in sources :

Example 1 with PivotChartReportElement

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);
}
Also used : PivotChartReportElement(org.activityinfo.legacy.shared.reports.model.PivotChartReportElement) DateDimension(org.activityinfo.legacy.shared.reports.model.DateDimension)

Example 2 with PivotChartReportElement

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());
}
Also used : IndicatorDAO(org.activityinfo.server.database.hibernate.dao.IndicatorDAO) GetDimensionLabels(org.activityinfo.legacy.shared.command.GetDimensionLabels) User(org.activityinfo.server.database.hibernate.entity.User) Dimension(org.activityinfo.legacy.shared.reports.model.Dimension) Indicator(org.activityinfo.server.database.hibernate.entity.Indicator) PivotSites(org.activityinfo.legacy.shared.command.PivotSites) DateRange(org.activityinfo.legacy.shared.reports.model.DateRange) Filter(org.activityinfo.legacy.shared.command.Filter) PivotChartGenerator(org.activityinfo.server.report.generator.PivotChartGenerator) PivotChartReportElement(org.activityinfo.legacy.shared.reports.model.PivotChartReportElement) DispatcherSync(org.activityinfo.server.command.DispatcherSync) Test(org.junit.Test)

Aggregations

PivotChartReportElement (org.activityinfo.legacy.shared.reports.model.PivotChartReportElement)2 Filter (org.activityinfo.legacy.shared.command.Filter)1 GetDimensionLabels (org.activityinfo.legacy.shared.command.GetDimensionLabels)1 PivotSites (org.activityinfo.legacy.shared.command.PivotSites)1 DateDimension (org.activityinfo.legacy.shared.reports.model.DateDimension)1 DateRange (org.activityinfo.legacy.shared.reports.model.DateRange)1 Dimension (org.activityinfo.legacy.shared.reports.model.Dimension)1 DispatcherSync (org.activityinfo.server.command.DispatcherSync)1 IndicatorDAO (org.activityinfo.server.database.hibernate.dao.IndicatorDAO)1 Indicator (org.activityinfo.server.database.hibernate.entity.Indicator)1 User (org.activityinfo.server.database.hibernate.entity.User)1 PivotChartGenerator (org.activityinfo.server.report.generator.PivotChartGenerator)1 Test (org.junit.Test)1