Author: croberts
Date: 2012-11-19 22:07:45 +0000 (Mon, 19 Nov 2012)
New Revision: 5551
Modified:
branches/croberts/cumin/python/cumin/stat.py
Log:
Cumin accounting group colors...now with more stability.
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-19 20:40:36 UTC (rev 5550)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-19 22:07:45 UTC (rev 5551)
@@ -1175,7 +1175,7 @@
# '#0000ff', '#00ff00', '#00ffff',
'#ff00ff', '#000000', '#666600', \
# '#6633cc', '#33ccb3', '#cc6633',
'#4dcc33', '#cc334d')
- colors =
("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#FFFFFF","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
+ colors =
("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
"#FF00AA","#FFFFAA","#FFAA00","#FFAAFF","#FFAAAA","#AA0000","#AA00FF","#AA00AA","#AAFF00","#AAFFFF","#AAFFAA","#AAAA00",\
"#AAAAFF","#AAAAAA","#000055","#00FF55","#00AA55","#005500","#0055FF","#0055AA","#005555","#FF0055","#FFFF55","#FFAA55",\
"#FF5500","#FF55FF","#FF55AA","#FF5555","#AA0055","#AAFF55","#AAAA55","#AA5500","#AA55FF","#AA55AA","#AA5555","#550000",\
@@ -1240,8 +1240,9 @@
for i, group in enumerate(all_groups):
color_map[group] = self.colors[i]
- # For all displayed stats, pull the mapped color into the array
- for stat in sorted(samples):
+ # For all displayed stats, pull the mapped color into the array
+ sample_keys = samples.keys()
+ for stat in sorted(sample_keys):
colors.append(color_map[stat])
return colors
@@ -1278,13 +1279,11 @@
chart.elements = list()
self.fix_samples(samples)
- for stat, color in reversed(zip(samples, self.colors)):
+ for stat in sorted(samples):
line = Element()
line.type = line_type
- line.fill = color
line.fill_alpha = self.alpha
-
- line.colour = color
+
line.width = line_width
tip_title = stat
line.text = mode == "rate" and "%s / sec" % tip_title or
self.get_line_title(stat)