use of org.dussan.vaadin.dcharts.DCharts in project Activiti by Activiti.
the class ChartComponent method addChart.
public void addChart(String description, Component chart, String errorMessage) {
addComponent(new Label(" ", Label.CONTENT_XHTML));
addComponent(new Label(" ", Label.CONTENT_XHTML));
// Description
if (description != null) {
Label label = new Label(description);
label.addStyleName(Reindeer.LABEL_H2);
addComponent(label);
addComponent(new Label(" ", Label.CONTENT_XHTML));
}
// Chart
if (chart != null) {
if (chart instanceof DCharts) {
// DCharts doesn't know how to size itself
chart.setWidth(600, UNITS_PIXELS);
chart.setHeight(450, UNITS_PIXELS);
((DCharts) chart).show();
}
addComponent(chart);
}
// Error message
if (errorMessage != null) {
Label errorLabel = new Label(errorMessage);
addComponent(errorLabel);
}
}
use of org.dussan.vaadin.dcharts.DCharts 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.DCharts 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.DCharts 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.DCharts 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);
}
Aggregations