aboutsummaryrefslogtreecommitdiff
path: root/mod/graphstats/views/default/graphs/timeline.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:50 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:50 -0300
commit971b54fe719ed70704fb3bcac4ef1d5f093cb454 (patch)
tree26e090c444b1e34881bc088a9cd6f3223e26047a /mod/graphstats/views/default/graphs/timeline.php
parent711dab09b5146e74dbeda56679c65e3b6bec71f3 (diff)
parent36102a094de700ee339f6eaeffb8ab16ba4f2f3b (diff)
downloadelgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.gz
elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.bz2
Merge commit '36102a094de700ee339f6eaeffb8ab16ba4f2f3b' as 'mod/graphstats'
Diffstat (limited to 'mod/graphstats/views/default/graphs/timeline.php')
-rw-r--r--mod/graphstats/views/default/graphs/timeline.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/graphstats/views/default/graphs/timeline.php b/mod/graphstats/views/default/graphs/timeline.php
new file mode 100644
index 000000000..08d47581f
--- /dev/null
+++ b/mod/graphstats/views/default/graphs/timeline.php
@@ -0,0 +1,44 @@
+<?php
+
+$json_url = $vars['json_url'];
+if(empty($json_url)) return true;
+
+elgg_load_js('simile.timeline');
+
+?>
+<div id="group-timeline" style="height: 300px; border: 1px solid #aaa"></div>
+<script type="text/javascript">
+$(function(){
+ var eventSource = new Timeline.DefaultEventSource();
+ var bandInfos = [
+ Timeline.createBandInfo({
+ width: "80%",
+ intervalUnit: Timeline.DateTime.DAY,
+ intervalPixels: 200,
+ eventSource: eventSource,
+ }),
+ Timeline.createBandInfo({
+ width: "20%",
+ intervalUnit: Timeline.DateTime.MONTH,
+ intervalPixels: 200,
+ eventSource: eventSource,
+ overview: true,
+ })
+ ];
+ bandInfos[1].syncWith = 0;
+ bandInfos[1].highlight = true;
+ tl = Timeline.create(document.getElementById("group-timeline"), bandInfos);
+ tl.loadJSON("<?php echo $json_url; ?>", function(json, url) {
+ eventSource.loadJSON(json, url);
+ });
+
+ $().resize(function(){
+ if (resizeTimerID == null) {
+ resizeTimerID = window.setTimeout(function() {
+ resizeTimerID = null;
+ tl.layout();
+ }, 500);
+ }
+ });
+});
+</script>