diff --git a/g.line.js b/g.line.js index a11d88b..8064cfc 100644 --- a/g.line.js +++ b/g.line.js @@ -110,16 +110,16 @@ if (opts.axis) { var ax = (opts.axis + "").split(/[,\s]+/); - +ax[0] && axis.push(chartinst.axis(x + gutter, y + gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 2, paper)); - +ax[1] && axis.push(chartinst.axis(x + width - gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 3, paper)); - +ax[2] && axis.push(chartinst.axis(x + gutter, y + height - gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper)); - +ax[3] && axis.push(chartinst.axis(x + gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper)); + (+ax[0] || +ax[2]) && chartinst.grid(x + gutter, gutter + 10, width - 2 * gutter, height - 2 * gutter, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper); + (+ax[1] || +ax[3]) && chartinst.grid(x + gutter, y + height - gutter, width - 2 * gutter, height - 2 * gutter, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper); } if (opts.axis) { var ax = (opts.axis + "").split(/[,\s]+/); - (+ax[0] || +ax[2]) && axis.push(chartinst.grid(x + gutter, 2 * gutter, width - 2 * gutter, height, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper)); - (+ax[1] || +ax[3]) && axis.push(chartinst.grid(x + gutter, y + height - gutter, width - 2 * gutter, height - 2 * gutter, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper)); + +ax[0] && axis.push(chartinst.axis(x + gutter, y + gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 2, paper)); + +ax[1] && axis.push(chartinst.axis(x + width - gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 3, paper)); + +ax[2] && axis.push(chartinst.axis(x + gutter, y + height - gutter, width - 2 * gutter, minx, maxx, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper)); + +ax[3] && axis.push(chartinst.axis(x + gutter, y + height - gutter, height - 2 * gutter, miny, maxy, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper)); } var lines = paper.set(), @@ -319,6 +319,7 @@ return this; }; + chart.opts = opts; return chart; }; diff --git a/g.raphael.js b/g.raphael.js index a5233db..f61e76f 100644 --- a/g.raphael.js +++ b/g.raphael.js @@ -811,6 +811,8 @@ Raphael.g = { grid = grid.concat(["M", X, y, "l", 0, height]); X += dx; } + grid = grid.concat(["M", X, y, "l", 0, height]); + } var grid = paper.path(grid);