X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fx-axis-formatter.html;h=d216c9796afbc593fe3a350c907529b301e7d94e;hb=bceff4bfe5fc77816c5c6f0025e38debfbfbfd0a;hp=96b3e06205998e0c4b30e81d1ae3ac157f8d50a2;hpb=bf640e568cb4c340010ed9ac60b905a4d93acd53;p=dygraphs.git diff --git a/tests/x-axis-formatter.html b/tests/x-axis-formatter.html index 96b3e06..d216c97 100644 --- a/tests/x-axis-formatter.html +++ b/tests/x-axis-formatter.html @@ -1,13 +1,17 @@ + - hourly + + X Axis Label Formatting - - - - + + +

Original data:

@@ -32,32 +36,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) { + 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()); + } } + } });