From d9e6fa471081631155f03455c9ff47626684bcd3 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Tue, 13 Apr 2010 14:40:12 -0700 Subject: [PATCH] add another underlay callback parameter, plus a nicer demo --- dygraph-canvas.js | 2 +- tests/highlighted-region.html | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tests/highlighted-region.html diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 2c18345..b83e54a 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -279,7 +279,7 @@ DygraphCanvasRenderer.prototype.render = function() { var ctx = this.element.getContext("2d"); if (this.options.underlayCallback) { - this.options.underlayCallback(ctx, this.area, this.layout); + this.options.underlayCallback(ctx, this.area, this.layout, this.dygraph_); } if (this.options.drawYGrid) { diff --git a/tests/highlighted-region.html b/tests/highlighted-region.html new file mode 100644 index 0000000..48d803e --- /dev/null +++ b/tests/highlighted-region.html @@ -0,0 +1,55 @@ + + + Highlighted Region + + + + + + + + +

Should draw a time series with an unusual region highlighted:

+
+ +

When you zoom/pan, the region should remain highlighted.

+ + + + -- 2.7.4