Skip to content

Commit

Permalink
See DmitryBaranovskiy#137: Made the gird size automatically to the da…
Browse files Browse the repository at this point in the history
…ta without the need for a transparent set of paths to do this.
  • Loading branch information
bigspotteddog committed Jul 7, 2012
1 parent dafbfda commit 2ff88c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions g.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@
var allx = Array.prototype.concat.apply([], valuesx);
var ally = Array.prototype.concat.apply([], valuesy);
var xdim = chartinst.snapEnds(Math.min.apply(Math, allx), Math.max.apply(Math, allx), valuesx[0].length - 1);
var minx = Math.min.apply(Math, allx);//xdim.from;
var maxx = Math.max.apply(Math, allx);//xdim.to;
var minx = opts.minx || Math.floor(Math.min.apply(Math, allx));//xdim.from;
var maxx = opts.maxx || Math.ceil(Math.max.apply(Math, allx));//xdim.to;
var ydim = chartinst.snapEnds(Math.min.apply(Math, ally), Math.max.apply(Math, ally), valuesy[0].length - 1);
var miny = Math.min.apply(Math, ally);//ydim.from;
var maxy = Math.max.apply(Math, ally);//ydim.to;
var miny = opts.miny || Math.floor(Math.min.apply(Math, ally));//ydim.from;
var maxy = opts.maxy || Math.ceil(Math.max.apply(Math, ally));//ydim.to;
var kx = (width - gutter * 2) / ((maxx - minx) || 1);
var ky = (height - gutter * 2) / ((maxy - miny) || 1);

Expand Down

0 comments on commit 2ff88c2

Please sign in to comment.