diff options
author | James Moger <james.moger@gitblit.com> | 2013-05-30 23:29:25 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-05-30 23:29:25 -0400 |
commit | cf17b2267bab439cadafbc1def298bae0d5ea659 (patch) | |
tree | 0896000f050112e5382dcf146300e89780a5a203 /src/main/java/com/gitblit/wicket/charting | |
parent | 962827130933297711bc6b4384edcc769e3eed05 (diff) | |
download | gitblit-cf17b2267bab439cadafbc1def298bae0d5ea659.tar.gz gitblit-cf17b2267bab439cadafbc1def298bae0d5ea659.zip |
Added a Dashboard page with a daily ref log of starred/owned repos
This is a work-in-progress and is mostly working like I want, but will require
some refactoring to make it even more useful and less complex.
Diffstat (limited to 'src/main/java/com/gitblit/wicket/charting')
-rw-r--r-- | src/main/java/com/gitblit/wicket/charting/GoogleChart.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/charting/GooglePieChart.java | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/wicket/charting/GoogleChart.java b/src/main/java/com/gitblit/wicket/charting/GoogleChart.java index b6309ffe..334b870d 100644 --- a/src/main/java/com/gitblit/wicket/charting/GoogleChart.java +++ b/src/main/java/com/gitblit/wicket/charting/GoogleChart.java @@ -38,6 +38,7 @@ public abstract class GoogleChart implements Serializable { final List<ChartValue> values;
int width;
int height;
+ boolean showLegend;
public GoogleChart(String tagId, String title, String keyName, String valueName) {
this.tagId = tagId;
@@ -46,6 +47,7 @@ public abstract class GoogleChart implements Serializable { this.keyName = keyName;
this.valueName = valueName;
values = new ArrayList<ChartValue>();
+ showLegend = true;
}
public void setWidth(int width) {
@@ -55,6 +57,10 @@ public abstract class GoogleChart implements Serializable { public void setHeight(int height) {
this.height = height;
}
+
+ public void setShowLegend(boolean val) {
+ this.showLegend = val;
+ }
public void addValue(String name, int value) {
values.add(new ChartValue(name, value));
diff --git a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java index 119a8248..945e08b1 100644 --- a/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java +++ b/src/main/java/com/gitblit/wicket/charting/GooglePieChart.java @@ -68,8 +68,8 @@ public class GooglePieChart extends GoogleChart { cName, tagId));
line(sb,
MessageFormat
- .format("{0}.draw({1}, '{'width: {2,number,0}, height: {3,number,0}, chartArea:'{'left:20,top:20'}', title: ''{4}'', {5} '}');",
- cName, dName, width, height, title, colors.toString()));
+ .format("{0}.draw({1}, '{' title: ''{4}'', {5}, legend: '{' position:''{6}'' '}' '}');",
+ cName, dName, width, height, title, colors.toString(), showLegend ? "right" : "none"));
line(sb, "");
}
}
\ No newline at end of file |