From 0457984cef51c24f08d32fd802eb7d3c8a204920 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 18 Jun 2013 21:55:25 -0400
Subject: [PATCH] Indicate default days back filter selection
---
src/main/java/com/gitblit/wicket/charting/GooglePieChart.java | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java
index a9b4667..1f5ae70 100644
--- a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java
+++ b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java
@@ -49,19 +49,11 @@
List<ChartValue> list = new ArrayList<ChartValue>();
int maxSlices = 10;
- int maxCount = Math.min(maxSlices - 1, values.size());
- for (int i = 0; i < maxCount; i++) {
- ChartValue value = values.get(i);
- list.add(value);
- }
- if (values.size() >= maxSlices) {
- float others = 0;
- for (int i = maxSlices - 1; i < values.size(); i++) {
- others += values.get(i).value;
- }
- ChartValue other = new ChartValue("other", others);
- list.add(other);
+ if (values.size() > maxSlices) {
+ list.addAll(values.subList(0, maxSlices));
+ } else {
+ list.addAll(values);
}
StringBuilder colors = new StringBuilder("colors:[");
--
Gitblit v1.9.1