[jboss-svn-commits] JBL Code SVN: r13840 - labs/jbosslabs/trunk/stats-server/kosmos/src/java/hu/midori/kosmos/server/util.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jul 30 05:59:45 EDT 2007
Author: wrzep
Date: 2007-07-30 05:59:45 -0400 (Mon, 30 Jul 2007)
New Revision: 13840
Modified:
labs/jbosslabs/trunk/stats-server/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java
Log:
JBLAB-874
Tan text background
-Pawel
Modified: labs/jbosslabs/trunk/stats-server/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java
===================================================================
--- labs/jbosslabs/trunk/stats-server/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2007-07-30 09:08:32 UTC (rev 13839)
+++ labs/jbosslabs/trunk/stats-server/kosmos/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2007-07-30 09:59:45 UTC (rev 13840)
@@ -34,6 +34,7 @@
* Utility methods for chart generation.
*
* @author <a href="mailto:aron.gombas at midori.hu">Aron Gombas</a>
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
* @version $Id$
*/
public class ChartUtils {
@@ -47,6 +48,8 @@
protected static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
/** Shape for the timeseries-charts. */
protected static final Shape RECTANGLE_SHAPE = new Rectangle(-1, -1, 2, 2);
+ /** Label background color */
+ protected static final Color LABEL_BACKGROUND_COLOR = Color.decode("#f8f4db");
/** This class should never be instantiated. */
protected ChartUtils() { }
@@ -59,9 +62,11 @@
// apply color-codes
PiePlot plot = (PiePlot)chart.getPlot();
- for(int i = 0; i < dataset.getItemCount(); i++)
+ for(int i = 0; i < dataset.getItemCount(); i++) {
plot.setSectionPaint(i, Colors.getPieColor(i));
-
+ plot.setLabelBackgroundPaint(LABEL_BACKGROUND_COLOR);
+ }
+
return chart;
}
@@ -77,8 +82,10 @@
// apply color-codes
PiePlot plot = (PiePlot)chart.getPlot();
- for(int i = 0; i < dataset.getItemCount(); i++)
+ for(int i = 0; i < dataset.getItemCount(); i++) {
plot.setSectionPaint(i, ((ColorCodedKey)dataset.getKey(i)).getColor());
+ plot.setLabelBackgroundPaint(LABEL_BACKGROUND_COLOR);
+ }
return chart;
}
More information about the jboss-svn-commits
mailing list