Reduce the width of testGridLinePattern from 480px to 120px, making the test run...
[dygraphs.git] / tests / x-axis-formatter.html
index b370a86..d216c97 100644 (file)
           "2009/07/12 06:00:00,4,6"
       }
 
-      new Dygraph(
+      var g1 = new Dygraph(
             document.getElementById("normal"),
             HourlyData()
           );
 
-      new Dygraph(
+      var g2 = new Dygraph(
             document.getElementById("offby2"),
             HourlyData(),
             { 
-              xAxisLabelFormatter:
-                function(d, gran) {
-                  return Dygraph.dateAxisFormatter(new Date(d.getTime() + 7200*1000), gran);
+              axes: {
+                x: {
+                  axisLabelFormatter: function(d, gran) {
+                      return Dygraph.dateAxisFormatter(new Date(d.getTime() + 7200*1000), gran);
+                  }
                 }
+              }
             });
 
-      new Dygraph(
+      var g3 = new Dygraph(
             document.getElementById("seconds"),
             HourlyData(),
             { 
               xAxisLabelWidth: 70,
-              xAxisLabelFormatter:
-                function(d, gran) {
-                  return Dygraph.zeropad(d.getHours()) + ":"
-                      + Dygraph.zeropad(d.getMinutes()) + ":"
-                      + Dygraph.zeropad(d.getSeconds());
+              axes: {
+                x: {
+                  axisLabelFormatter: function(d, gran) {
+                    return Dygraph.zeropad(d.getHours()) + ":"
+                        + Dygraph.zeropad(d.getMinutes()) + ":"
+                        + Dygraph.zeropad(d.getSeconds());
+                  }
                 }
+              }
             });
     </script>
   </body>