From 62c6c062fb588712f600c79ce0cd45b4c55f0ba6 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 10 Aug 2011 14:42:58 -0400 Subject: [PATCH] update a few tests --- tests/x-axis-formatter.html | 22 ++++++++++++++-------- tests/y-axis-formatter.html | 36 ++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/tests/x-axis-formatter.html b/tests/x-axis-formatter.html index b370a86..b008ad8 100644 --- a/tests/x-axis-formatter.html +++ b/tests/x-axis-formatter.html @@ -45,10 +45,13 @@ 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( @@ -56,12 +59,15 @@ 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()); + } } + } }); diff --git a/tests/y-axis-formatter.html b/tests/y-axis-formatter.html index f3313b8..f2fbd00 100644 --- a/tests/y-axis-formatter.html +++ b/tests/y-axis-formatter.html @@ -51,11 +51,15 @@ ], { 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 + }, + } + } } ); @@ -74,15 +78,19 @@ ], { 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 + } + } + } } ); -- 2.7.4