[rhmessaging-commits] rhmessaging commits: r1552 - mgmt/cumin/python/cumin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Fri Jan 11 12:30:06 EST 2008
Author: justi9
Date: 2008-01-11 12:30:05 -0500 (Fri, 11 Jan 2008)
New Revision: 1552
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/stat.strings
Log:
Improvements to the x axis display in charts.
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-01-11 16:55:50 UTC (rev 1551)
+++ mgmt/cumin/python/cumin/charts.py 2008-01-11 17:30:05 UTC (rev 1552)
@@ -51,7 +51,7 @@
self.stroke(cr)
- def plot_x_axis(self, interval):
+ def plot_x_axis(self, interval, step):
cr = Context(self.surface)
cr.set_line_width(0.2)
cr.set_source_rgb(0.6, 0.6, 0.6)
@@ -62,7 +62,7 @@
cr.move_to(x, 0)
cr.line_to(x, self.height + 10)
- if i % 2 == 0:
+ if i % step == 0:
value = self.x_max - (self.x_max * x / float(self.width))
cr.show_text(fmt_duration_brief(value))
@@ -70,7 +70,7 @@
self.stroke(cr)
- def plot_y_axis(self, interval):
+ def plot_y_axis(self, interval, step):
cr = Context(self.surface)
cr.set_line_width(0.2)
cr.set_source_rgb(0.6, 0.6, 0.6)
@@ -81,7 +81,7 @@
cr.move_to(0, y)
cr.line_to(self.width + 2, y)
- if i % 2 == 0:
+ if i % step == 0:
value = int(self.y_max - (self.y_max * y / float(self.height)))
if value > 10000:
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-01-11 16:55:50 UTC (rev 1551)
+++ mgmt/cumin/python/cumin/stat.py 2008-01-11 17:30:05 UTC (rev 1552)
@@ -188,9 +188,15 @@
chart.set_x_max(duration)
chart.set_y_max(max_value)
- chart.plot_x_axis(48)
- chart.plot_y_axis(20)
+ x_interval = 40
+ step = 2
+ if duration == 600:
+ x_interval = 48
+
+ chart.plot_x_axis(x_interval, step)
+ chart.plot_y_axis(20, 2)
+
colors = ((1,0,0), (0,0,1), (0,1,0))
for stat, color in zip(stats, colors):
Modified: mgmt/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/cumin/python/cumin/stat.strings 2008-01-11 16:55:50 UTC (rev 1551)
+++ mgmt/cumin/python/cumin/stat.strings 2008-01-11 17:30:05 UTC (rev 1552)
@@ -92,12 +92,16 @@
padding: 0 0.4em;
}
+table.StatValueChart ul.radiotabs li {
+ display: block;
+}
+
[StatValueChart.html]
<table class="StatValueChart">
<tr>
<td><img id="{id}" src="{href}" height="140" width="540"/></td>
<td>
- {stats}
+ <ul>{stats}</ul>
<br/>
{duration}
</td>
@@ -108,5 +112,7 @@
</script>
[StatValueChart.stat_html]
-<span class="swatch" style="background-color: {stat_color}"> </span> {stat_value}
-<br/>
+<li>
+ <span class="swatch" style="background-color: {stat_color}"> </span>
+ {stat_value}
+</li>
More information about the rhmessaging-commits
mailing list