From 644667ccc605fcf199784c44f28a41446fc2daef Mon Sep 17 00:00:00 2001
From: David Ostrovsky <david@ostrovsky.org>
Date: Mon, 02 Dec 2013 15:50:41 -0500
Subject: [PATCH] Bump bouncycastle version to 1.49
---
src/main/java/com/gitblit/wicket/charting/GooglePieChart.java | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 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..546a2a9 100644
--- a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java
+++ b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java
@@ -24,9 +24,9 @@
/**
* Builds an interactive pie chart using the Visualization API.
- *
+ *
* @author James Moger
- *
+ *
*/
public class GooglePieChart extends GoogleChart {
@@ -47,23 +47,15 @@
Collections.sort(values);
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) {
+ list.addAll(values.subList(0, maxSlices));
+ } else {
+ list.addAll(values);
}
- 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);
- }
-
+
StringBuilder colors = new StringBuilder("colors:[");
for (int i = 0; i < list.size(); i++) {
ChartValue value = list.get(i);
--
Gitblit v1.9.1