From e9d78bacc2271758c0c9472c37a402f4c3a45faf Mon Sep 17 00:00:00 2001 From: Ben Winslow Date: Fri, 4 Mar 2011 02:47:44 -0500 Subject: [PATCH] Fix CSVs with a numeric (non-date) X axis and add a test for that case. --- dygraph.js | 2 +- tests/csv-numeric-x.html | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/csv-numeric-x.html diff --git a/dygraph.js b/dygraph.js index 656d7a8..7f312b6 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2870,7 +2870,7 @@ Dygraph.prototype.detectTypeFromString_ = function(str) { this.attrs_.xTicker = Dygraph.dateTicker; this.attrs_.xAxisLabelFormatter = Dygraph.dateAxisFormatter; } else { - this.attrs_.xValueFormatter = this.attrs_.xValueFormatter; + this.attrs_.xValueFormatter = this.attrs_.yValueFormatter; this.attrs_.xValueParser = function(x) { return parseFloat(x); }; this.attrs_.xTicker = Dygraph.numericTicks; this.attrs_.xAxisLabelFormatter = this.attrs_.xValueFormatter; diff --git a/tests/csv-numeric-x.html b/tests/csv-numeric-x.html new file mode 100644 index 0000000..29d5781 --- /dev/null +++ b/tests/csv-numeric-x.html @@ -0,0 +1,27 @@ + + + CSV with numeric X series + + + + + + + +

CSV data with a numeric (non-date) X series.

+
+ + + -- 2.7.4