From 087c94911ee888bc744e758063d630802ba93165 Mon Sep 17 00:00:00 2001 From: ben hengst Date: Tue, 13 Mar 2012 14:13:20 -0700 Subject: [PATCH] adding the ablility to pass opacity via opts to barcharts --- g.bar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g.bar.js b/g.bar.js index b0834b7..8255ab2 100644 --- a/g.bar.js +++ b/g.bar.js @@ -210,7 +210,7 @@ for (var j = 0; j < (multi || 1); j++) { var h = Math.round((multi ? values[j][i] : values[i]) * Y), top = y + height - barvgutter - h, - bar = finger(Math.round(X + barwidth / 2), top + h, barwidth, h, true, type, null, paper).attr({ stroke: "none", fill: colors[multi ? j : i] }); + bar = finger(Math.round(X + barwidth / 2), top + h, barwidth, h, true, type, null, paper).attr({ stroke: "none", fill: colors[multi ? j : i], 'fill-opacity' : opts.opacity || 1 }); if (multi) { bars[j].push(bar); @@ -454,7 +454,7 @@ for (var j = 0; j < (multi || 1); j++) { var val = multi ? values[j][i] : values[i], - bar = finger(x, Y + barheight / 2, Math.round(val * X), barheight - 1, false, type, null, paper).attr({stroke: "none", fill: colors[multi ? j : i]}); + bar = finger(x, Y + barheight / 2, Math.round(val * X), barheight - 1, false, type, null, paper).attr({stroke: "none", fill: colors[multi ? j : i], 'fill-opacity' : opts.opacity || 1 }); if (multi) { bars[j].push(bar);