Search in sources :

Example 6 with AbstractOrderedLayout

use of com.vaadin.ui.AbstractOrderedLayout in project cia by Hack23.

the class PersonDocumentChartDataManagerImpl method createPersonDocumentHistoryChart.

@Override
public void createPersonDocumentHistoryChart(final AbstractOrderedLayout content, final String personId) {
    final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
    final DataSeries dataSeries = new DataSeries();
    final Series series = new Series();
    final Map<String, List<ViewRiksdagenPoliticianDocumentDailySummary>> allMap = getViewRiksdagenPoliticianDocumentDailySummaryMap();
    final List<ViewRiksdagenPoliticianDocumentDailySummary> itemList = allMap.get(personId.toUpperCase(Locale.ENGLISH).replace(UNDER_SCORE, EMPTY_STRING).trim());
    if (itemList != null) {
        final Map<String, List<ViewRiksdagenPoliticianDocumentDailySummary>> map = itemList.parallelStream().filter(Objects::nonNull).collect(Collectors.groupingBy(t -> StringUtils.defaultIfBlank(t.getEmbeddedId().getDocumentType(), NO_INFO)));
        addDocumentHistoryByPersonData(simpleDateFormat, dataSeries, series, map);
    }
    addChart(content, DOCUMENT_HISTORY, new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(), true);
}
Also used : DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) StringUtils(org.apache.commons.lang.StringUtils) Logger(org.slf4j.Logger) PersonDocumentChartDataManager(com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.PersonDocumentChartDataManager) LoggerFactory(org.slf4j.LoggerFactory) SimpleDateFormat(java.text.SimpleDateFormat) ViewRiksdagenPoliticianDocumentDailySummary(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocumentDailySummary) Collectors(java.util.stream.Collectors) RiksdagenDocumentPersonSummaryEmbeddedId(com.hack23.cia.model.internal.application.data.document.impl.RiksdagenDocumentPersonSummaryEmbeddedId) Objects(java.util.Objects) DCharts(org.dussan.vaadin.dcharts.DCharts) DataContainer(com.hack23.cia.service.api.DataContainer) List(java.util.List) Locale(java.util.Locale) Service(org.springframework.stereotype.Service) Map(java.util.Map) Series(org.dussan.vaadin.dcharts.options.Series) Entry(java.util.Map.Entry) XYseries(org.dussan.vaadin.dcharts.base.elements.XYseries) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) Series(org.dussan.vaadin.dcharts.options.Series) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) List(java.util.List) DCharts(org.dussan.vaadin.dcharts.DCharts) SimpleDateFormat(java.text.SimpleDateFormat) ViewRiksdagenPoliticianDocumentDailySummary(com.hack23.cia.model.internal.application.data.document.impl.ViewRiksdagenPoliticianDocumentDailySummary)

Aggregations

AbstractOrderedLayout (com.vaadin.ui.AbstractOrderedLayout)6 DataContainer (com.hack23.cia.service.api.DataContainer)3 SimpleDateFormat (java.text.SimpleDateFormat)3 List (java.util.List)3 Locale (java.util.Locale)3 Map (java.util.Map)3 Entry (java.util.Map.Entry)3 Objects (java.util.Objects)3 Collectors (java.util.stream.Collectors)3 DCharts (org.dussan.vaadin.dcharts.DCharts)3 XYseries (org.dussan.vaadin.dcharts.base.elements.XYseries)3 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)3 Series (org.dussan.vaadin.dcharts.options.Series)3 Service (org.springframework.stereotype.Service)3 CubaHorizontalActionsLayout (com.haulmont.cuba.web.toolkit.ui.CubaHorizontalActionsLayout)2 CubaVerticalActionsLayout (com.haulmont.cuba.web.toolkit.ui.CubaVerticalActionsLayout)2 StringUtils (org.apache.commons.lang.StringUtils)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId (com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId)1