From 18c3170678fd3e5961b42bca95a44e975704d071 Mon Sep 17 00:00:00 2001 From: Joseph Cava-Lynch Date: Sat, 7 Jul 2012 18:42:23 -0700 Subject: [PATCH] See #137: More refactoring. --- g.line.js | 10 ---------- g.raphael.js | 37 ------------------------------------- 2 files changed, 47 deletions(-) diff --git a/g.line.js b/g.line.js index 390ade0..2389e5d 100644 --- a/g.line.js +++ b/g.line.js @@ -105,16 +105,6 @@ var axis = paper.set(); - if (opts.axis) { - var ax = (opts.axis + "").split(/[,\s]+/); - //(+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); - if (+ax[1] || +ax[3]) { - var grid = chartinst.grid(x + gutter, y + height - gutter, width - 2 * gutter, height - 2 * gutter, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper); - chart.yaxis = grid; - axis.push(grid); - } - } - if (opts.axis) { var axisLabelsInside = 1; if (opts.axisLabelsInside) { diff --git a/g.raphael.js b/g.raphael.js index c304b38..a4b59a8 100644 --- a/g.raphael.js +++ b/g.raphael.js @@ -789,43 +789,6 @@ Raphael.g = { return { from: f, to: t, power: i }; }, - grid: function (x, y, width, height, steps, orientation, paper) { - steps = steps || 10; - paper = arguments[arguments.length-1] //paper is always last argument - - var grid = []; - - if (+orientation == 1 || +orientation == 3) { - var Y = y; - var dx = height / steps; - - while (Y >= y - height) { - grid = grid.concat(["M", x, Y, "l", width, 0]); - Y -= dx; - } - } else { - var X = x; - var dx = width / steps; - - while (X <= x + width) { - 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); - grid.attr ("stroke", "#efefef"); - - var res = paper.path(grid); - - res.remove = function () { - this.constructor.prototype.remove.call(this); - }; - - return res; - }, - axis: function (x, y, length, from, to, steps, orientation, labels, type, dashsize, paper) { dashsize = dashsize == null ? 2 : dashsize; type = type || "t";