Author: croberts
Date: 2013-03-11 13:38:20 +0000 (Mon, 11 Mar 2013)
New Revision: 5736
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/stat.py
trunk/cumin/python/cumin/stat.strings
Log:
Fixing BZ 911503 by shrinking the negotiator throughput chart a bit horizontally. Also
added plumbing to make chart sizing more flexible.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2013-03-08 19:47:59 UTC (rev 5735)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2013-03-11 13:38:20 UTC (rev 5736)
@@ -841,6 +841,8 @@
chart = self.ThroughputChart(app, "timeseries",
throughput_stats.negotiator)
chart.duration.param.default = "3600"
chart.stats = self.attrs[:-1]
+ chart.width = 350
+ chart.container_width = 28
self.add_child(chart)
class ThroughputChart(StatFlashChart):
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2013-03-08 19:47:59 UTC (rev 5735)
+++ trunk/cumin/python/cumin/stat.py 2013-03-11 13:38:20 UTC (rev 5736)
@@ -146,6 +146,9 @@
self.chart_type = None
self.title = None
self.colors = None
+ self.height = 150
+ self.width = 400
+ self.container_width = 33 #em not px
self.stats_tmpl = WidgetTemplate(self, "stat_html")
@@ -205,10 +208,13 @@
return getattr(cls, self.stats[0]).title
def render_width(self, session):
- return 360
+ return "%spx" % self.width
def render_height(self, session):
- return 100
+ return "%spx" % self.height
+
+ def render_container_width(self, session):
+ return "%sem" % self.container_width
class ReportingStatValueChart(StatValueChart):
def __init__(self, app, name, cls):
@@ -278,12 +284,6 @@
params = self.get_href_params(session)
return escape_entity("flashpage.html?" + ";".join(params))
- def render_width(self, session):
- return 360
-
- def render_height(self, session):
- return 120
-
def render_id_nodots(self, session):
return self.render_id(session).replace(".", "_")
@@ -309,10 +309,10 @@
return escape_entity("flashpage.html?" + ";".join(params))
def render_width(self, session):
- return 360
+ return "%spx" % self.width
def render_height(self, session):
- return 120
+ return "%spx" % self.height
def render_id_nodots(self, session):
return self.render_id(session).replace(".", "_")
Modified: trunk/cumin/python/cumin/stat.strings
===================================================================
--- trunk/cumin/python/cumin/stat.strings 2013-03-08 19:47:59 UTC (rev 5735)
+++ trunk/cumin/python/cumin/stat.strings 2013-03-11 13:38:20 UTC (rev 5736)
@@ -141,7 +141,6 @@
font-size: 0.9em;
margin: 0 0 1.5em 0;
position: relative;
- width: 33em;
}
div.StatValueChart div.duration {
@@ -300,7 +299,7 @@
[StatValueChart.html]
<div>
-<div class="StatValueChart{fullpageable}" id="{id}">
+<div class="StatValueChart{fullpageable}" id="{id}"
style="width:{container_width}">
<h2>{title}</h2>
<div class="duration">{duration}</div>
@@ -325,14 +324,14 @@
[StatFlashChart.html]
<div>
- <div class="StatValueChart{fullpageable}" id="{id}">
+ <div class="StatValueChart{fullpageable}" id="{id}"
style="width:{container_width}">
<h2>{title}</h2>
<div class="duration"
style="float:left;">{duration}</div>
<div style="clear:both;"></div>
<div>
<!-- don't put this data url inside the holder div, jqplot will kill it
on a zoom -->
<a rel="api" type="application/json"
href="{href}" style="display:none">Data</a>
- <div id="{id_nodots}_chart" class="jqplotgraph leftlegend"
style="height:150px;width:400px;">
+ <div id="{id_nodots}_chart" class="jqplotgraph leftlegend"
style="height:{height};width:{width};">
<div class="loading"
style="display:none;"><span>Loading...</span></div>
</div>
</div>
@@ -349,7 +348,7 @@
<div>
<!-- don't put this data url inside the holder div, jqplot will kill it
on a zoom -->
<a rel="api" type="application/json"
href="{href}" style="display:none">Data</a>
- <div id="{id_nodots}_chart" class="jqplotgraph leftlegend"
style="height:150px;width:400px;">
+ <div id="{id_nodots}_chart" class="jqplotgraph leftlegend"
style="height:{height};width:{width};">
<div class="loading"
style="display:none;"><span>Loading...</span></div>
</div>
</div>
Show replies by date