repositoryMetrics.get(repository).count += entry.getValue().count;
}
}
// build charts
Charts charts = new Flotr2Charts();
// sort in reverse-chronological order and then reverse that
Collections.sort(recentActivity);
Collections.reverse(recentActivity);
// daily line chart
Chart chart = charts.createLineChart("chartDaily", getString("gb.dailyActivity"), "day",
getString("gb.commits"));
SimpleDateFormat df = new SimpleDateFormat("MMM dd");
df.setTimeZone(getTimeZone());
for (Activity metric : recentActivity) {
chart.addValue(metric.startDate, metric.getCommitCount());
}
charts.addChart(chart);
// active repositories pie chart
chart = charts.createPieChart("chartRepositories", getString("gb.activeRepositories"),
getString("gb.repository"), getString("gb.commits"));
for (Metric metric : repositoryMetrics.values()) {
chart.addValue(metric.name, metric.count);
}
chart.setShowLegend(false);
String url = urlFor(SummaryPage.class, null).toString() + "?r=";
chart.setClickUrl(url);
charts.addChart(chart);
// active authors pie chart
chart = charts.createPieChart("chartAuthors", getString("gb.activeAuthors"),
getString("gb.author"), getString("gb.commits"));
for (Metric metric : authorMetrics.values()) {
chart.addValue(metric.name, metric.count);
}
chart.setShowLegend(false);
charts.addChart(chart);
return charts;
}