From: Ben Winslow Date: Fri, 4 Mar 2011 07:47:44 +0000 (-0500) Subject: Fix CSVs with a numeric (non-date) X axis and add a test for that case. X-Git-Tag: v1.0.0~559^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=e9d78bacc2271758c0c9472c37a402f4c3a45faf;p=dygraphs.git Fix CSVs with a numeric (non-date) X axis and add a test for that case. --- 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.

+
+ + +