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

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:23:55 PDT 2014


Revision: 12711
          http://trac.calendarserver.org//changeset/12711
Author:   wsanchez at apple.com
Date:     2014-02-14 16:43:12 -0800 (Fri, 14 Feb 2014)
Log Message:
-----------
Placeholder chart

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

Modified: CalendarServer/trunk/calendarserver/webadmin/work.xhtml
===================================================================
--- CalendarServer/trunk/calendarserver/webadmin/work.xhtml	2014-02-15 00:42:49 UTC (rev 12710)
+++ CalendarServer/trunk/calendarserver/webadmin/work.xhtml	2014-02-15 00:43:12 UTC (rev 12711)
@@ -3,16 +3,54 @@
 
   <head>
     <title><t:slot name="title" /></title>
-    <link t:render="stylesheet" />
+    <!-- <link t:render="stylesheet" /> -->
+
+    <style>
+      #work_queues_chart div {
+        font-size: 0.5em;
+        font-family: sans-serif;
+
+        color: white;
+        background-color: steelblue;
+
+        text-align: right;
+        padding: 0.5em;
+        margin: 0.2em;
+      }
+    </style>
+
+    <script src="http://d3js.org/d3.v3.min.js" charset="utf-8" />
+    <script type="text/javascript">
+
+      window.onload = function() {
+
+        var data = [4, 8, 15, 16, 23, 42];
+
+        /* scale is a function that normalizes a value in data into the range 0-98 */
+        var scale = d3.scale.linear()
+                      .domain([0, d3.max(data)])
+                      .range([0, 98])
+
+        var bars = d3.select(".chart")
+                     .selectAll("div")
+                       .data(data)
+                     .enter().append("div")
+
+        bars.style("width", function(d) { return scale(d) + "%"; })
+        bars.text(function(d) { return d; });
+
+      }
+
+    </script>
+
   </head>
 
   <body>
 
     <h1><t:slot name="title" /></h1>
 
+    <div id="work_queues_chart" class="chart" />
 
-
-
   </body>
 
 </html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/3cc21898/attachment.html>


More information about the calendarserver-changes mailing list