summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2012-04-11 22:40:21 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2012-04-11 22:40:21 +0200
commit70d76981d2c8ec696e0f755c11b1ee05e85a658a (patch)
tree41c591f31171feb360ac0ea67d3f247b7e20196d /templates
parent71ab4141c718ac0bf6eabc3452a1d4d310bca60e (diff)
Make the bar of the plot clickable
Diffstat (limited to 'templates')
-rw-r--r--templates/recent_activities.html17
1 files changed, 3 insertions, 14 deletions
diff --git a/templates/recent_activities.html b/templates/recent_activities.html
index 7d88aa6..53f0ef9 100644
--- a/templates/recent_activities.html
+++ b/templates/recent_activities.html
@@ -15,6 +15,8 @@
<div id="fig">
<script type="text/javascript+protovis" >
+var dates = ["{{dates_string|join:'","'}}"];
+
var data = {{evolution}},
w = 500,
h = 300,
@@ -31,6 +33,7 @@ var vis = new pv.Panel()
var bar = vis.add(pv.Bar)
.data(data)
+ .event("click", function(n) self.location = "/archives/{{list_address}}/" + dates[this.index])
.left(function() x(this.index))
.width(x.range().band)
.bottom(0)
@@ -42,20 +45,6 @@ var title = vis.add(pv.Label)
.textAlign("center")
.text("Activities on the list over the last 30 days");
-/*
-bar.anchor("top").add(pv.Label)
- .textStyle("white")
- .text(function(d) d.toFixed(1));
-*/
-
-/*
-bar.anchor("bottom").add(pv.Label)
- .textMargin(5)
- .textAlign("right")
- .textBaseline("middle")
- .textAngle(-Math.PI / 2);
-*/
-
vis.add(pv.Rule)
.data(y.ticks())
.bottom(function(d) Math.round(y(d)) - .5)