use of org.dussan.vaadin.dcharts.data.DataSeries in project cia by Hack23.
the class AdminChartDataManagerImpl method createApplicationActionEventPageModeDailySummaryChart.
@Override
public void createApplicationActionEventPageModeDailySummaryChart(final AbstractOrderedLayout content, final String page) {
final Map<String, List<ViewApplicationActionEventPageModeDailySummary>> map = getApplicationActionEventPageModeDailySummaryMap(page);
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<ViewApplicationActionEventPageModeDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
final List<ViewApplicationActionEventPageModeDailySummary> list = entry.getValue();
for (final ViewApplicationActionEventPageModeDailySummary item : list) {
if (item != null) {
dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getCreatedDate()), item.getHits());
}
}
}
}
addChart(content, "Page Action Events daily Summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(), true);
}
use of org.dussan.vaadin.dcharts.data.DataSeries in project cia by Hack23.
the class CommitteeDataSeriesFactoryImpl method createChartTimeSeriesTotalDaysServedCommitteeByParty.
@Override
public DataSeries createChartTimeSeriesTotalDaysServedCommitteeByParty() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenParty, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenParty.class);
final DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = applicationManager.getDataContainer(ViewRiksdagenPartySummary.class);
partySummarydataContainer.getAll();
for (final ViewRiksdagenParty data : dataContainer.getAll()) {
final ViewRiksdagenPartySummary summary = partySummarydataContainer.load(data.getPartyId());
if (summary != null && summary.isActive()) {
dataSeries = dataSeries.newSeries().add(data.getPartyName(), summary.getTotalDaysServedCommittee());
}
}
return dataSeries;
}
use of org.dussan.vaadin.dcharts.data.DataSeries in project cia by Hack23.
the class MinistryDataSeriesFactoryImpl method createMinistryChartTimeSeriesCurrent.
@Override
public DataSeries createMinistryChartTimeSeriesCurrent() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenMinistry, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenMinistry.class);
for (final ViewRiksdagenMinistry data : dataContainer.getAll()) {
if (data.isActive()) {
dataSeries = dataSeries.newSeries().add(data.getNameId(), data.getCurrentMemberSize());
}
}
return dataSeries;
}
use of org.dussan.vaadin.dcharts.data.DataSeries in project cia by Hack23.
the class MinistryDataSeriesFactoryImpl method createMinistryChartTimeSeriesAll.
@Override
public DataSeries createMinistryChartTimeSeriesAll() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenMinistry, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenMinistry.class);
for (final ViewRiksdagenMinistry data : dataContainer.getAll()) {
dataSeries = dataSeries.newSeries().add(data.getNameId(), data.getTotalAssignments());
}
return dataSeries;
}
use of org.dussan.vaadin.dcharts.data.DataSeries in project cia by Hack23.
the class PartyDataSeriesFactoryImpl method createChartTimeSeriesCurrentGovernmentByParty.
@Override
public DataSeries createChartTimeSeriesCurrentGovernmentByParty() {
DataSeries dataSeries = new DataSeries();
final DataContainer<ViewRiksdagenParty, String> dataContainer = applicationManager.getDataContainer(ViewRiksdagenParty.class);
final DataContainer<ViewRiksdagenPartySummary, String> partySummarydataContainer = applicationManager.getDataContainer(ViewRiksdagenPartySummary.class);
partySummarydataContainer.getAll();
for (final ViewRiksdagenParty data : dataContainer.getAll()) {
final ViewRiksdagenPartySummary summary = partySummarydataContainer.load(data.getPartyId());
if (summary != null && summary.isActive()) {
dataSeries = dataSeries.newSeries().add(data.getPartyName(), summary.getTotalActiveGovernment());
}
}
return dataSeries;
}
Aggregations