Author: croberts
Date: 2011-10-12 18:33:17 +0000 (Wed, 12 Oct 2011)
New Revision: 5060
Modified:
branches/noflash/cumin/python/cumin/stat.py
Log:
Bringing in a bug fix from trunk to prevent some charts from erroring out.
Modified: branches/noflash/cumin/python/cumin/stat.py
===================================================================
--- branches/noflash/cumin/python/cumin/stat.py 2011-10-12 16:15:55 UTC (rev 5059)
+++ branches/noflash/cumin/python/cumin/stat.py 2011-10-12 18:33:17 UTC (rev 5060)
@@ -559,6 +559,10 @@
min_value = float(min_value)
max_value = round(max_value * 1.1 + 1)
+ if type == "percent" and max_value > 100:
+ # since none of our percentage graphs go above 100%
+ # we limit it here to match the flash graph
+ max_value = 100
if min_value < 0:
min_value = round(min_value * 1.1 - 1)
@@ -945,7 +949,7 @@
value = int(round(i * y_step, 0))
if value >= 1000000:
- svalue = "%.2fm" % (round(value / 1000000.0, 2))
+ svalue = "%.2fM" % (round(value / 1000000.0, 2))
elif value >= 10000:
svalue = "%ik" % int(round(value / 1000.0, -1))
else:
@@ -1186,7 +1190,7 @@
self.alpha = 1
- def get_max_min(self, session, stats, samples):
+ def get_max_min(self, session, stats, samples, time_span, end_seconds_ago):
max_value = 0
min_value = 0
points = dict()
@@ -1324,8 +1328,8 @@
return chart_obj
class PercentAreaChart(AreaChart):
- def get_max_min(self, session, stats, samples):
- max_val, min_val = super(PercentAreaChart, self).get_max_min(session, stats,
samples)
+ def get_max_min(self, session, stats, samples, time_span, end_seconds_ago):
+ max_val, min_val = super(PercentAreaChart, self).get_max_min(session, stats,
samples, time_span, end_seconds_ago)
percent = self.page.percent_property.get(session)
total = self.page.get_object_property(session, percent)
Show replies by date