From 937029dffe23b54b2269a180ece191c5625744e5 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Fri, 24 Sep 2010 10:52:53 -0400 Subject: [PATCH] Fix to bug 111, now always rendering all points whether they're in the canvas viewport. This allows any graphics that radiate from the point to be rendered. --- dygraph-canvas.js | 9 +-------- dygraph.js | 6 +++--- tests/data.js | 10 ++++++++++ tests/visibility.html | 2 +- tests/zoom.html | 4 ++-- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 8d3bfe2..182f29d 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -19,7 +19,7 @@ DygraphLayout = function(dygraph, options) { this.options = {}; // TODO(danvk): remove, use attr_ instead. Dygraph.update(this.options, options ? options : {}); this.datasets = new Array(); - this.annotations = new Array() + this.annotations = new Array(); }; DygraphLayout.prototype.attr_ = function(name) { @@ -103,13 +103,6 @@ DygraphLayout.prototype._evaluateLineCharts = function() { name: setName }; - // limit the x, y values so they do not overdraw - if (point.y <= 0.0) { - point.y = 0.0; - } - if (point.y >= 1.0) { - point.y = 1.0; - } this.points.push(point); } } diff --git a/dygraph.js b/dygraph.js index f20e1e1..5a8b9ca 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1012,9 +1012,9 @@ Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) { Dygraph.prototype.doZoomY_ = function(lowY, highY) { // Find the highest and lowest values in pixel range. var r = this.toDataCoords(null, lowY); - var minValue = r[1]; - r = this.toDataCoords(null, highY); var maxValue = r[1]; + r = this.toDataCoords(null, highY); + var minValue = r[1]; this.doZoomYValues_(minValue, maxValue); }; @@ -1029,7 +1029,7 @@ Dygraph.prototype.doZoomY_ = function(lowY, highY) { * @private */ Dygraph.prototype.doZoomYValues_ = function(minValue, maxValue) { - this.valueWindow_ = [maxValue, minValue]; + this.valueWindow_ = [minValue, maxValue]; this.drawGraph_(this.rawData_); if (this.attr_("zoomCallback")) { var xRange = this.xAxisRange(); diff --git a/tests/data.js b/tests/data.js index 5f61b95..3cf75fb 100644 --- a/tests/data.js +++ b/tests/data.js @@ -435,6 +435,16 @@ return "" + "20061129,1.41093474427,0.495309102312,3.02013422819,0.701020603129"; } +function NoisyData2() { +return "" + +"Date,A,B\n" + +"20061027,2.30905861456\n" + +"20061028,4.09252669039\n" + +"20061029,2.66903914591\n" + +"20061030,4.74516695958\n" + +"20061031,2.78260869565\n" + +"20061101,1.5873015873\n"; +} function data_showzerovalues() { return "" + "20070101,0,39\n" + diff --git a/tests/visibility.html b/tests/visibility.html index 01f0ef0..c18feb8 100644 --- a/tests/visibility.html +++ b/tests/visibility.html @@ -1,6 +1,6 @@ - noise + visibility diff --git a/tests/zoom.html b/tests/zoom.html index 608ae6d..24a2828 100644 --- a/tests/zoom.html +++ b/tests/zoom.html @@ -1,6 +1,6 @@ - noise + zoom @@ -23,7 +23,7 @@       -   +  
    -- 2.7.4