Skip to content

Commit

Permalink
See DmitryBaranovskiy#137: Removed the shrinking of x values. Some mi…
Browse files Browse the repository at this point in the history
…nor changes to get the index of the items hovered so other data can be displayed.
  • Loading branch information
bigspotteddog committed Jul 7, 2012
1 parent 0d3b665 commit 6a7f69c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions g.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@
shades.push(paper.path().attr({ stroke: "none", fill: colors[i], opacity: opts.nostroke ? 1 : .3 }));
}

if (valuesy[i].length > width - 2 * gutter) {
valuesy[i] = shrink(valuesy[i], width - 2 * gutter);
len = width - 2 * gutter;
}

if (valuesx[i] && valuesx[i].length > width - 2 * gutter) {
valuesx[i] = shrink(valuesx[i], width - 2 * gutter);
}
//if (valuesy[i].length > width - 2 * gutter) {
// valuesy[i] = shrink(valuesy[i], width - 2 * gutter);
// len = width - 2 * gutter;
//}

//if (valuesx[i] && valuesx[i].length > width - 2 * gutter) {
// valuesx[i] = shrink(valuesx[i], width - 2 * gutter);
//}
}

var allx = Array.prototype.concat.apply([], valuesx);
Expand Down Expand Up @@ -225,6 +225,7 @@
C.y = [];
C.x = xs[i];
C.axis = Xs[i];
C.index = [];

for (var j = 0, jj = valuesy.length; j < jj; j++) {
Xs2 = valuesx[j] || valuesx[0];
Expand All @@ -234,13 +235,15 @@
C.values.push(valuesy[j][k]);
C.y.push(y + height - gutter - (valuesy[j][k] - miny) * ky);
C.symbols.push(chart.symbols[j][k]);
C.index.push(k);
}
}
}

f && f.call(C);
}

console.log(cvrs);
!f && (columns = cvrs);
}

Expand Down
6 changes: 3 additions & 3 deletions g.raphael.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,9 @@ Raphael.g = {

var path = type == "|" || type == " " ? ["M", x + .5, y, "l", 0, .001] : orientation == 1 || orientation == 3 ? ["M", x + .5, y, "l", 0, -length] : ["M", x, y + .5, "l", length, 0],
ends = this.snapEnds(from, to, steps),
f = ends.from,
t = ends.to,
i = ends.power,
f = from, //ends.from,
t = to, //ends.to,
i = 0, //ends.power,
j = 0,
txtattr = { font: "11px 'Fontin Sans', Fontin-Sans, sans-serif" },
text = paper.set(),
Expand Down

0 comments on commit 6a7f69c

Please sign in to comment.