- var yNormal;
- if (axis.logscale) {
- yNormal = 1.0 - ((Dygraph.log10(yValue) - Dygraph.log10(axis.minyval)) * axis.ylogscale);
- } else {
- yNormal = 1.0 - ((yValue - axis.minyval) * axis.yscale);
- }
-
- // Current pixel coordinates that the data point would fill.
- currXPx = Math.round(xNormal * graphWidth);
- currYPx = Math.round(yNormal * graphHeight);
-
- // Skip over pushing points that lie on the same pixel.
- // TODO(antrob): optimize this for graphs with error bars.
- if (skip_opt || prevXPx != currXPx || prevYPx != currYPx) {
- var point = {
- // TODO(danvk): here
- x: xNormal,
- y: yNormal,
- xval: xValue,
- yval: yValue,
- name: setName
- };
- this.points.push(point);
- }
- prevXPx = currXPx;
- prevYPx = currYPx;
+ var xNormal = (xValue - this.minxval) * this.xscale;
+ // Range from 0-1 where 0 represents top and 1 represents bottom
+ var yNormal = DygraphLayout._calcYNormal(axis, yValue);
+
+ var point = {
+ // TODO(danvk): here
+ x: xNormal,
+ y: yNormal,
+ xval: xValue,
+ yval: yValue,
+ name: setName
+ };
+ this.points.push(point);
+ setPointsLength += 1;