From: Dan Vanderkam Date: Wed, 25 Nov 2009 20:44:07 +0000 (-0500) Subject: various fixes for the gadget -- it works in google docs now! X-Git-Tag: v1.0.0~876 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=33127159a1b5e23b1b7bf649e7d693915d198767;p=dygraphs.git various fixes for the gadget -- it works in google docs now! --- diff --git a/dygraph-combined.js b/dygraph-combined.js index ff580dc..2e6f734 100644 --- a/dygraph-combined.js +++ b/dygraph-combined.js @@ -5707,7 +5707,7 @@ this.attrs_.xValueFormatter=Dygraph.dateString_; this.attrs_.xValueParser=Dygraph.dateParser; this.attrs_.xTicker=Dygraph.dateTicker; }else{ -if(_217!="number"){ +if(_217=="number"){ this.attrs_.xValueFormatter=function(x){ return x; }; @@ -5716,7 +5716,7 @@ return parseFloat(x); }; this.attrs_.xTicker=Dygraph.numericTicks; }else{ -this.error("only 'date' and 'number' types are supported for column 1"+"of DataTable input (Got '"+_217+"')"); +this.error("only 'date' and 'number' types are supported for column 1 "+"of DataTable input (Got '"+_217+"')"); return null; } } diff --git a/dygraph.js b/dygraph.js index 6ef0835..94b536d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1397,12 +1397,12 @@ Dygraph.prototype.parseDataTable_ = function(data) { this.attrs_.xValueFormatter = Dygraph.dateString_; this.attrs_.xValueParser = Dygraph.dateParser; this.attrs_.xTicker = Dygraph.dateTicker; - } else if (indepType != 'number') { + } else if (indepType == 'number') { this.attrs_.xValueFormatter = function(x) { return x; }; this.attrs_.xValueParser = function(x) { return parseFloat(x); }; this.attrs_.xTicker = Dygraph.numericTicks; } else { - this.error("only 'date' and 'number' types are supported for column 1" + + this.error("only 'date' and 'number' types are supported for column 1 " + "of DataTable input (Got '" + indepType + "')"); return null; } diff --git a/gadget.xml b/gadget.xml index 3bc4281..53dee08 100644 --- a/gadget.xml +++ b/gadget.xml @@ -86,9 +86,6 @@ // var options = {showRowNumber: true}; var prefs = new _IG_Prefs(); // User preferences chart.draw(data, { - xValueParser: function(x) { return parseFloat(x); }, - xValueFormatter: function(x) { return x; }, - xTicker: DateGraph.prototype.numericTicks }); };