Documentation updates
[dygraphs.git] / tests / x-axis-formatter.html
index a2f7827..3f8f01c 100644 (file)
@@ -1,11 +1,8 @@
 <!DOCTYPE html>
 <html>
   <head>
+    <link rel="stylesheet" href="../dist/dygraph.css">
     <title>X Axis Label Formatting</title>
-    <!--
-    For production (minified) code, use:
-    <script type="text/javascript" src="dygraph-combined.js"></script>
-    -->
     <script type="text/javascript" src="../dist/dygraph.js"></script>
 
   </head>
@@ -31,6 +28,9 @@
           "2009/07/12 05:00:00,3,6\n" +
           "2009/07/12 06:00:00,4,6"
       }
+      function zeropad(x) {
+        return (x < 10) ? '0' + x : x;
+      }
 
       var g1 = new Dygraph(
             document.getElementById("normal"),
             document.getElementById("seconds"),
             HourlyData(),
             { 
-              xAxisLabelWidth: 70,
               axes: {
                 x: {
+                  axisLabelWidth: 70,
                   axisLabelFormatter: function(d, gran) {
-                    return Dygraph.zeropad(d.getHours()) + ":"
-                        + Dygraph.zeropad(d.getMinutes()) + ":"
-                        + Dygraph.zeropad(d.getSeconds());
+                    return zeropad(d.getHours()) + ":"
+                        + zeropad(d.getMinutes()) + ":"
+                        + zeropad(d.getSeconds());
                   }
                 }
               }