From 33127159a1b5e23b1b7bf649e7d693915d198767 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 25 Nov 2009 15:44:07 -0500 Subject: [PATCH] various fixes for the gadget -- it works in google docs now! --- dygraph-combined.js | 4 ++-- dygraph.js | 4 ++-- gadget.xml | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) 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 }); }; -- 2.7.4