diff options
Diffstat (limited to 'templates/recent_activities.html')
| -rw-r--r-- | templates/recent_activities.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/templates/recent_activities.html b/templates/recent_activities.html index c0a5aa8..eefb7b8 100644 --- a/templates/recent_activities.html +++ b/templates/recent_activities.html @@ -5,11 +5,66 @@ {% block additional_headers %} <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/stats.css" /> +<script type="text/javascript" src="{{ STATIC_URL }}protovis-d3.1.js"></script> {% endblock %} {% block content %} <section id="recent_activities"> + <section id="graph"> + <div id="fig"> + <script type="text/javascript+protovis" > + +var data = {{evolution}}, + w = 500, + h = 300, + x = pv.Scale.ordinal(pv.range(30)).splitBanded(0, w, 4/5), + y = pv.Scale.linear(0, {{evolution|length}}).range(0, h); + +var vis = new pv.Panel() + .width(w) + .height(h) + .bottom(20) + .left(30) + .right(5) + .top(5); + +var bar = vis.add(pv.Bar) + .data(data) + .left(function() x(this.index)) + .width(x.range().band) + .bottom(0) + .height(y); +/* +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) + .strokeStyle(function(d) d ? "rgba(255,255,255,.3)" : "#000") + .add(pv.Rule) + .left(0) + .width(5) + .strokeStyle("#000") + .anchor("left").add(pv.Label) + .text(function(d) d.toFixed(1)); + +vis.render(); + + </script> + </div> + </section> <section id="most_active"> <h2>Recently active discussions</h2> {% for email in most_active_threads %} |
