From 4440f6c8202461745a7e0d5977a990ef4fea1a9c Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 30 Jan 2010 19:41:08 -0800 Subject: [PATCH] Fix Kenny's numeric gviz bug and add a test --- dygraph.js | 2 +- tests/numeric-gviz.html | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/numeric-gviz.html diff --git a/dygraph.js b/dygraph.js index a08f668..ea25980 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1693,7 +1693,7 @@ Dygraph.prototype.parseDataTable_ = function(data) { cols = labels.length; var indepType = data.getColumnType(0); - if (indepType == 'date' || 'datetime') { + if (indepType == 'date' || indepType == 'datetime') { this.attrs_.xValueFormatter = Dygraph.dateString_; this.attrs_.xValueParser = Dygraph.dateParser; this.attrs_.xTicker = Dygraph.dateTicker; diff --git a/tests/numeric-gviz.html b/tests/numeric-gviz.html new file mode 100644 index 0000000..11457a8 --- /dev/null +++ b/tests/numeric-gviz.html @@ -0,0 +1,35 @@ + + + numeric gviz + + + + + + + + + + +

This tests that dygraphs can display gviz DataTable's with a numeric + x-axis.

+
+ + -- 2.7.4