integration/js/streamgraph.js
changeset 28 10a958322a62
parent 26 94f586daa623
child 29 5e0e0884b03a
--- a/integration/js/streamgraph.js	Thu Jan 24 16:58:55 2013 +0100
+++ b/integration/js/streamgraph.js	Tue Jan 29 13:29:21 2013 +0100
@@ -4,32 +4,14 @@
    
     var VMARGIN = 3,
         YEARSHEIGHT = 20,
-        STARTTIME = new Date(2007,5,1),
-        ENDTIME = new Date(),
+        STARTTIME = new Date(data.from_date),
+        ENDTIME = new Date(data.to_date),
         DATASTART = new Date(data.from_date),
         DATAEND = new Date(data.to_date),
         CURVE = .25,
         DATEPADDING = 10,
-        COLORS = [ "#943a23", "#fbee97", "#cfbb95", "#da9761", "#ba5036" ],
-        SELECTEDCOLOR = "#007dad"; 
-    
-    /* Generating random data
-    
-    var data = [],
-        clustercount = 12,
-        slicecount = 20,
-        maxdata = 10,
-        randpart = 4,
-        dampfactor = .333;
-    for (var i = 0; i < clustercount; i++) {
-        var line = [],
-            peaktime = Math.floor(Math.random() * slicecount);
-        for (var j = 0; j < slicecount; j++) {
-            var point = Math.min(maxdata, Math.max(0, (Math.random() - .5) * randpart + Math.max(0, maxdata * (1 - dampfactor * Math.abs(j - peaktime)))));
-            line.push(point);
-        }
-        data.push(line);
-    }
+        COLORS = [ "#51585E", "#12161C", "#457DAD", "#899DAA", "#0781BD" ],
+        SELECTEDCOLOR = "#c51810"; 
     
     /* Calculating scales and positions */
     
@@ -104,9 +86,8 @@
    
     var paper = new Raphael($selector[0]);
     
-    paper.path("M0 " + centery + "L" + width + " " + centery).attr({
-        stroke: "#000",
-        "stroke-width": .25
+    paper.path("M0 " + (1+centery) + "L" + width + " " + (1+centery)).attr({
+        stroke: "#000"
     })
     
     _(coords).each(function(line, index) {