if (point.y >= 1.0) {
point.y = 1.0;
}
- if ((point.x >= 0.0) && (point.x <= 1.0)) {
- this.points.push(point);
- }
+ this.points.push(point);
}
}
};
"drawXGrid": true,
"gridLineColor": "rgb(128,128,128)",
"fillAlpha": 0.15,
+ "underlayCallback": null
};
Dygraph.update(this.options, options);
DygraphCanvasRenderer.prototype.render = function() {
// Draw the new X/Y grid
var ctx = this.element.getContext("2d");
+
+ if (this.options.underlayCallback) {
+ this.options.underlayCallback(ctx, this.area, this.layout);
+ }
+
if (this.options.drawYGrid) {
var ticks = this.layout.yticks;
ctx.save();
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = this.options.strokeWidth;
- var prevX = -1;
+ var prevX = NaN;
var prevYs = [-1, -1];
var count = 0;
var yscale = this.layout.yscale;
count++;
if (point.name == setName) {
if (!isOK(point.y)) {
- prevX = -1;
+ prevX = NaN;
continue;
}
// TODO(danvk): here
point.y + point.errorMinus * yscale ];
newYs[0] = this.area.h * newYs[0] + this.area.y;
newYs[1] = this.area.h * newYs[1] + this.area.y;
- if (prevX >= 0) {
+ if (!isNaN(prevX)) {
ctx.moveTo(prevX, prevYs[0]);
ctx.lineTo(point.canvasx, newYs[0]);
ctx.lineTo(point.canvasx, newYs[1]);
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = this.options.strokeWidth;
- var prevX = -1;
+ var prevX = NaN;
var prevYs = [-1, -1];
var count = 0;
var yscale = this.layout.yscale;
count++;
if (point.name == setName) {
if (!isOK(point.y)) {
- prevX = -1;
+ prevX = NaN;
continue;
}
var pX = 1.0 + this.layout.minyval * this.layout.yscale;
var newYs = [ point.y, pX ];
newYs[0] = this.area.h * newYs[0] + this.area.y;
newYs[1] = this.area.h * newYs[1] + this.area.y;
- if (prevX >= 0) {
+ if (!isNaN(prevX)) {
ctx.moveTo(prevX, prevYs[0]);
ctx.lineTo(point.canvasx, newYs[0]);
ctx.lineTo(point.canvasx, newYs[1]);