update a few tests
authorDan Vanderkam <dan@dygraphs.com>
Wed, 10 Aug 2011 18:42:58 +0000 (14:42 -0400)
committerDan Vanderkam <dan@dygraphs.com>
Wed, 10 Aug 2011 18:42:58 +0000 (14:42 -0400)
tests/x-axis-formatter.html
tests/y-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>
index f3313b8..f2fbd00 100644 (file)
                 ],
                 {
                     stepPlot: true,
-                    yValueFormatter: function(x) {
-                        var shift = Math.pow(10, 5)
-                        return Math.round(x * shift) / shift
-                    },
-                    labels: ["X", "Data"]
+                    labels: ["X", "Data"],
+                    axes: {
+                      y: {
+                        valueFormatter: function(x) {
+                          var shift = Math.pow(10, 5)
+                          return Math.round(x * shift) / shift
+                        },
+                      }
+                    }
                 }
             );
         </script>
                 ],
                 {
                     stepPlot: true,
-                    yValueFormatter: function(x) {
-                        var shift = Math.pow(10, 5)
-                        return "*" + Math.round(x * shift) / shift
-                    },
-                    yAxisLabelFormatter: function(x) {
-                        var shift = Math.pow(10, 5)
-                        return "+" + Math.round(x * shift) / shift
-                    },
-                    labels: ["X", "Data"]
+                    labels: ["X", "Data"],
+                    axes: {
+                      y: {
+                        valueFormatter: function(x) {
+                          var shift = Math.pow(10, 5)
+                          return "*" + Math.round(x * shift) / shift
+                        },
+                        axisLabelFormatter: function(x) {
+                          var shift = Math.pow(10, 5)
+                          return "+" + Math.round(x * shift) / shift
+                        }
+                      }
+                    }
                 }
             );
         </script>