List of usage examples for com.vaadin.ui AbstractOrderedLayout setCaption
@Override public void setCaption(String caption)
From source file:com.hack23.cia.web.impl.ui.application.views.common.chartfactory.impl.BallotChartDataManagerImpl.java
License:Apache License
@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;/* w w w. j ava2 s . com*/ 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(chartOptions.createOptionsDonoutChartWithSeries(series)).show()); }