Search in sources :

Example 1 with ViewApplicationActionEventPageElementDailySummary

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

the class AdminChartDataManagerImpl method createApplicationActionEventPageElementDailySummaryChart.

@Override
public void createApplicationActionEventPageElementDailySummaryChart(final AbstractOrderedLayout content, final String page, final String elementId) {
    final List<ViewApplicationActionEventPageElementDailySummary> list = getApplicationActionEventPageElementDailySummaryList(page, elementId);
    final DataSeries dataSeries = new DataSeries();
    final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
    final Series series = new Series();
    series.addSeries(new XYseries().setLabel(PAGE_HITS));
    dataSeries.newSeries();
    for (final ViewApplicationActionEventPageElementDailySummary item : list) {
        if (item != null) {
            dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getCreatedDate()), item.getHits());
        }
    }
    series.addSeries(new XYseries().setLabel(PAGE_RANK));
    dataSeries.newSeries();
    for (final ViewApplicationActionEventPageElementDailySummary item : list) {
        if (item != null) {
            dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getCreatedDate()), item.getRank());
        }
    }
    addChart(content, "Page element 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) ViewApplicationActionEventPageElementDailySummary(com.hack23.cia.model.internal.application.data.impl.ViewApplicationActionEventPageElementDailySummary) DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) DCharts(org.dussan.vaadin.dcharts.DCharts) XYseries(org.dussan.vaadin.dcharts.base.elements.XYseries) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

ViewApplicationActionEventPageElementDailySummary (com.hack23.cia.model.internal.application.data.impl.ViewApplicationActionEventPageElementDailySummary)1 SimpleDateFormat (java.text.SimpleDateFormat)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