summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2012-04-12 07:34:48 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2012-04-12 07:34:48 +0200
commit93b4ca1270745a81be571952e483560c0fc31ab1 (patch)
tree267929a13e7c34211558e5164f923c956df8d063
parentda96181ab6e355a2576f050cdef7948c05d37635 (diff)
downloadhyperkitty-93b4ca1270745a81be571952e483560c0fc31ab1.tar.gz
hyperkitty-93b4ca1270745a81be571952e483560c0fc31ab1.tar.xz
hyperkitty-93b4ca1270745a81be571952e483560c0fc31ab1.zip
Split the date at the bottom of the graph and change the orientation to 45°
-rw-r--r--templates/recent_activities.html18
1 files changed, 16 insertions, 2 deletions
diff --git a/templates/recent_activities.html b/templates/recent_activities.html
index 67643cc..d8b6ace 100644
--- a/templates/recent_activities.html
+++ b/templates/recent_activities.html
@@ -17,6 +17,8 @@
var dates = ["{{dates_string|join:'","'}}"];
+
+
var data = {{evolution}},
w = 500,
h = 300,
@@ -43,8 +45,20 @@ bar.anchor("bottom").add(pv.Label)
.textMargin(5)
.textAlign("right")
.textBaseline("middle")
- .textAngle(-Math.PI / 2)
- .text(function() dates[this.index]);
+ .textAngle(-Math.PI / 3)
+ .text(function() xlabel(this.index));
+
+function xlabel(ind){
+ if (!dates[ind -1]){
+ return dates[ind];
+ }
+ prev = dates[ind - 1];
+ cur = dates[ind];
+ if (prev.substring(0,7) == cur.substring(0,7)){
+ cur = cur.substring(8);
+ }
+ return cur;
+}
var title = vis.add(pv.Label)
.left(250)