// TODO(danvk): Any performance issues with this?
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
- var i = 4 * (x + imageData.width * y);
+ var scale = Dygraph.getContextPixelRatio(ctx);
+
+ var i = 4 * (x * scale + imageData.width * y * scale);
var d = imageData.data;
return [d[i], d[i+1], d[i+2], d[i+3]];
};