Author: croberts
Date: 2012-11-05 17:28:12 +0000 (Mon, 05 Nov 2012)
New Revision: 5536
Modified:
branches/croberts/cumin/python/cumin/grid/dashboard.py
branches/croberts/cumin/python/cumin/stat.py
branches/croberts/cumin/python/cumin/stat.strings
branches/croberts/cumin/resources/app.js
Log:
additional chart customization
Modified: branches/croberts/cumin/python/cumin/grid/dashboard.py
===================================================================
--- branches/croberts/cumin/python/cumin/grid/dashboard.py 2012-11-02 15:31:31 UTC (rev
5535)
+++ branches/croberts/cumin/python/cumin/grid/dashboard.py 2012-11-05 17:28:12 UTC (rev
5536)
@@ -83,6 +83,8 @@
chart.chart_type = "genusechart"
chart.duration.param.default = "86400"
chart.leftlegend = False
+ chart.height = 150
+ chart.width = 400
charts.add_child(chart)
def render_title(self, session):
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-02 15:31:31 UTC (rev 5535)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-05 17:28:12 UTC (rev 5536)
@@ -145,6 +145,8 @@
self.stats = ()
self.chart_type = None
self.title = None
+ self.width = 400
+ self.height = 150
self.stats_tmpl = WidgetTemplate(self, "stat_html")
@@ -200,10 +202,10 @@
return getattr(cls, self.stats[0]).title
def render_width(self, session):
- return 360
+ return self.width
def render_height(self, session):
- return 100
+ return self.height
class ReportingStatValueChart(StatValueChart):
def __init__(self, app, name, cls):
@@ -270,10 +272,10 @@
return escape_entity("flashpage.html?" + ";".join(params))
def render_width(self, session):
- return 360
+ return self.width
def render_height(self, session):
- return 120
+ return self.height
def render_id_nodots(self, session):
return self.render_id(session).replace(".", "_")
@@ -302,13 +304,7 @@
def render_fullpage_href(self, session):
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(".", "_")
@@ -1176,8 +1172,8 @@
self.legendLocation = "e"
self.fillAndStroke = False
self.gridPadding = "{top:10, right:20, bottom:20, left:20}" #gets
eval'ed in js to form gridPadding object
- self.legendCols = 1
- self.fillAlpha = 0.4
+ self.legendCols = 2
+ self.fillAlpha = 1
self.accGroups = self.AccGroupSqlOperation(app)
self.accUse = self.AccGroupUseSqlOperation(app, self)
Modified: branches/croberts/cumin/python/cumin/stat.strings
===================================================================
--- branches/croberts/cumin/python/cumin/stat.strings 2012-11-02 15:31:31 UTC (rev 5535)
+++ branches/croberts/cumin/python/cumin/stat.strings 2012-11-05 17:28:12 UTC (rev 5536)
@@ -332,7 +332,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}px;width:{width}px;">
<div class="loading"
style="display:none;"><span>Loading...</span></div>
</div>
</div>
@@ -349,7 +349,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}px;width:{width}px;">
<div class="loading"
style="display:none;"><span>Loading...</span></div>
</div>
</div>
Modified: branches/croberts/cumin/resources/app.js
===================================================================
--- branches/croberts/cumin/resources/app.js 2012-11-02 15:31:31 UTC (rev 5535)
+++ branches/croberts/cumin/resources/app.js 2012-11-05 17:28:12 UTC (rev 5536)
@@ -634,7 +634,7 @@
gridPadding: dataContainer['gridPadding'],
grid: { background: '#FFFFFF' },
legend: {
- show:true,
+ show: dataContainer['labels'][0] == "No data" ? false:true,
location: dataContainer['legendLocation'],
renderer: $j.jqplot.EnhancedLegendRenderer,
yoffset: 0,