X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fx-axis-formatter.html;h=a2f78270a9fa83c343ee0929a01e43a9a43a3523;hb=4dbba4b17c6203b3c1493fd99dfcf12cb88103e7;hp=b370a8637f92543471ebde1a306629ecbf00f197;hpb=7e5ddc9488079169a4311f870727043b5216a81e;p=dygraphs.git
diff --git a/tests/x-axis-formatter.html b/tests/x-axis-formatter.html
index b370a86..a2f7827 100644
--- a/tests/x-axis-formatter.html
+++ b/tests/x-axis-formatter.html
@@ -1,16 +1,12 @@
-
X Axis Label Formatting
-
-
+
@@ -36,32 +32,38 @@
"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, opts) {
+ return Dygraph.dateAxisLabelFormatter(new Date(d.getTime() + 7200*1000), gran, opts);
+ }
}
+ }
});
- 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());
+ }
}
+ }
});