X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=dygraph.js;h=0fc48cef97e2e07b5d2bc553bb362c2afda3af8b;hb=25b70e09fe463ced2ee49f7af2f47cf74c131b01;hp=a0e55ab0309130c22ad6ca58c4af394dfcd7b4a8;hpb=7aabde9615cc6425512e40ec8dc7680ad264a161;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index a0e55ab..0fc48ce 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2936,7 +2936,8 @@ Dygraph.prototype.parseFloat_ = function(x, opt_line_no, opt_line) { */ Dygraph.prototype.parseCSV_ = function(data) { var ret = []; - var lines = data.split("\n"); + var line_delimiter = Dygraph.detectLineDelimiter(data); + var lines = data.split(line_delimiter || "\n"); var vals, j; // Use the default delimiter or fall back to a tab if that makes sense. @@ -3292,7 +3293,8 @@ Dygraph.prototype.start_ = function() { this.predraw_(); } else if (typeof data == 'string') { // Heuristic: a newline means it's CSV data. Otherwise it's an URL. - if (data.indexOf('\n') >= 0) { + var line_delimiter = Dygraph.detectLineDelimiter(data); + if (line_delimiter) { this.loadedEvent_(data); } else { var req = new XMLHttpRequest();