Skip to content
Browse files

Corrections to some of the line math used for the grid.

  • Loading branch information...
1 parent 94c74aa commit c7a40e3d817dc94dd5d4f7fa2b883b2dd4ae88a1 Matt Farmer committed Apr 4, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 g.line.js
  2. +1 −1 g.raphael.js
View
4 g.line.js
@@ -112,10 +112,10 @@
if (opts.grid) {
if (opts.grid.vertical)
- chartinst.grid(x+gutter, y+height-gutter, height, width, axisystep, 1, opts.grid.verticalcolor, paper);
+ chartinst.grid(x+gutter, y+height-gutter, height - 2*gutter, width - 2*gutter, axisystep, 1, opts.grid.verticalcolor, paper);
if (opts.grid.horizontal)
- chartinst.grid(x+gutter, y-gutter, width, height, axisxstep, 0, opts.grid.horizontalcolor, paper);
+ chartinst.grid(x+gutter, y+gutter, width - 2*gutter, height - 2*gutter, axisxstep, 0, opts.grid.horizontalcolor, paper);
}
if (opts.axis) {
View
2 g.raphael.js
@@ -792,7 +792,7 @@ Raphael.g = {
grid: function(x, y, length, linelength, steps, orientation, color, paper) {
steps = steps || 10;
- var path = orientation == 1 || orientation == 3 ? ["M", x + .5, y, "l", 0, -length] : ["M", x, y + .5, "l", length, 0],
+ var path = [],
dx = length / steps,
color = color || "#000000";

0 comments on commit c7a40e3

Please sign in to comment.
Something went wrong with that request. Please try again.