Factor out ticker functions and clean up their semantics/usage.
[dygraphs.git] / tests / x-axis-formatter.html
index b370a86..b008ad8 100644 (file)
             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(
             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>