Search in sources :

Example 1 with ViewApplicationActionEventPageDailySummary

use of com.hack23.cia.model.internal.application.data.impl.ViewApplicationActionEventPageDailySummary in project cia by Hack23.

the class AdminChartDataManagerImpl method createApplicationActionEventPageDailySummaryChart.

@Override
public void createApplicationActionEventPageDailySummaryChart(final AbstractOrderedLayout content) {
    final Map<String, List<ViewApplicationActionEventPageDailySummary>> map = getApplicationActionEventPageDailySummaryMap();
    final DataSeries dataSeries = new DataSeries();
    final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
    final Series series = new Series();
    for (final Entry<String, List<ViewApplicationActionEventPageDailySummary>> entry : map.entrySet()) {
        if (entry.getKey() != null) {
            series.addSeries(new XYseries().setLabel(entry.getKey()));
            dataSeries.newSeries();
            final List<ViewApplicationActionEventPageDailySummary> list = entry.getValue();
            for (final ViewApplicationActionEventPageDailySummary viewRiksdagenVoteDataBallotPartySummaryDaily : list) {
                if (viewRiksdagenVoteDataBallotPartySummaryDaily != null) {
                    dataSeries.add(simpleDateFormat.format(viewRiksdagenVoteDataBallotPartySummaryDaily.getEmbeddedId().getCreatedDate()), viewRiksdagenVoteDataBallotPartySummaryDaily.getHits());
                }
            }
        }
    }
    addChart(content, "Application Action Events daily Summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(), true);
}
Also used : DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) Series(org.dussan.vaadin.dcharts.options.Series) List(java.util.List) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) ViewApplicationActionEventPageDailySummary(com.hack23.cia.model.internal.application.data.impl.ViewApplicationActionEventPageDailySummary) DCharts(org.dussan.vaadin.dcharts.DCharts) XYseries(org.dussan.vaadin.dcharts.base.elements.XYseries) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

ViewApplicationActionEventPageDailySummary (com.hack23.cia.model.internal.application.data.impl.ViewApplicationActionEventPageDailySummary)1 SimpleDateFormat (java.text.SimpleDateFormat)1 List (java.util.List)1 DCharts (org.dussan.vaadin.dcharts.DCharts)1 XYseries (org.dussan.vaadin.dcharts.base.elements.XYseries)1 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)1 Series (org.dussan.vaadin.dcharts.options.Series)1