use of org.dussan.vaadin.dcharts.base.elements.XYseries 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);
}
use of org.dussan.vaadin.dcharts.base.elements.XYseries 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);
}
use of org.dussan.vaadin.dcharts.base.elements.XYseries in project cia by Hack23.
the class BallotChartDataManagerImpl method createChart.
@Override
public void createChart(final Tab tab, final AbstractOrderedLayout content, final List<ViewRiksdagenVoteDataBallotPartySummary> partyList) {
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
series.addSeries(new XYseries().setLabel("Yes"));
series.addSeries(new XYseries().setLabel("No"));
series.addSeries(new XYseries().setLabel("Abstain"));
series.addSeries(new XYseries().setLabel("Absent"));
String caption = null;
for (final ViewRiksdagenVoteDataBallotPartySummary viewRiksdagenVoteDataBallotPartySummary : partyList) {
if (caption == null) {
caption = "Party Summary : " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getConcern();
content.setCaption(caption);
tab.setCaption(caption);
}
dataSeries.newSeries().add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyYesVotes()).add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyNoVotes()).add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyAbstainVotes()).add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyAbsentVotes());
}
addChart(content, caption + " ( 4 circles Yes/No/Abstain/Absent votes by party )", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChartWithSeries(series)).show(), true);
}
use of org.dussan.vaadin.dcharts.base.elements.XYseries in project cia by Hack23.
the class DecisionChartDataManagerImpl method createDecisionTypeChart.
@Override
public void createDecisionTypeChart(final AbstractOrderedLayout content) {
final Map<String, List<ViewRiksdagenCommitteeDecisionTypeDailySummary>> map = getCommitteeDecisionTypeMap();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
for (final Entry<String, List<ViewRiksdagenCommitteeDecisionTypeDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
final List<ViewRiksdagenCommitteeDecisionTypeDailySummary> list = entry.getValue();
for (final ViewRiksdagenCommitteeDecisionTypeDailySummary item : list) {
if (item != null) {
dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getDecisionDate()), item.getTotal());
}
}
}
}
addChart(content, "Decision type daily summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(), true);
}
use of org.dussan.vaadin.dcharts.base.elements.XYseries in project cia by Hack23.
the class DocumentChartDataManagerImpl method addDataSeries.
/**
* Adds the data series.
*
* @param simpleDateFormat the simple date format
* @param parseInputDateFormat the parse input date format
* @param dataSeries the data series
* @param series the series
* @param entry the entry
*/
private static void addDataSeries(final SimpleDateFormat simpleDateFormat, final SimpleDateFormat parseInputDateFormat, final DataSeries dataSeries, final Series series, final Entry<String, List<ViewRiksdagenDocumentTypeDailySummary>> entry) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
for (final ViewRiksdagenDocumentTypeDailySummary item : entry.getValue()) {
if (item != null && item.getEmbeddedId().getPublicDate().length() > 0) {
try {
dataSeries.add(simpleDateFormat.format(parseInputDateFormat.parse(item.getEmbeddedId().getPublicDate())), item.getTotal());
} catch (final ParseException e) {
LOGGER.warn("Problem parsing date:{}", item.getEmbeddedId().getPublicDate());
}
}
}
}
Aggregations