[CalendarServer-changes] [12793] CalendarServer/trunk/calendarserver/webadmin/work.xhtml

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 4 10:55:52 PST 2014


Revision: 12793
          http://trac.calendarserver.org//changeset/12793
Author:   wsanchez at apple.com
Date:     2014-03-04 10:55:52 -0800 (Tue, 04 Mar 2014)
Log Message:
-----------
Have the x-axis remember it's max value and only increase it's range.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/webadmin/work.xhtml

Modified: CalendarServer/trunk/calendarserver/webadmin/work.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/work.xhtml	2014-03-04 18:55:12 UTC (rev 12792)
+++ CalendarServer/trunk/calendarserver/webadmin/work.xhtml	2014-03-04 18:55:52 UTC (rev 12793)
@@ -37,6 +37,7 @@
 
     <script src="http://d3js.org/d3.v3.min.js"></script>
     <script>
+    //<![CDATA[
 
       var workTableDescriptions = {
         // Scheduling
@@ -71,6 +72,8 @@
         "FIND_MIN_VALID_REVISION_WORK": "Revision Cleanup: Find Minimum",
       };
 
+      var maxSeen = 30;
+
       function drawChart(data) {
         items = [];
 
@@ -104,9 +107,13 @@
 
         var xInset = 1;
 
+        var max = d3.max(items, function(i) { return i.count; });
+
+        if (max > maxSeen) { maxSeen = max; }
+
         var xLocation =
           d3.scale.linear()
-            .domain([0, d3.max(items, function(i) { return i.count; })])
+            .domain([0, maxSeen])
             .range([xInset, innerWidth])
           ;
 
@@ -198,7 +205,7 @@
         data = {};
 
         for (key in workTableDescriptions) {
-          data[key] = 30;
+          data[key] = 0;
         }
 
         drawChart(data);
@@ -220,6 +227,7 @@
         registerForEvents();
       };
 
+    //]]>
     </script>
 
   </head>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140304/a7c552e5/attachment-0001.html>


More information about the calendarserver-changes mailing list