var legend = function (labels, otherslabel, mark, dir) {
var x = cx + r + r / 5,
- y = cy,
- h = y + 10;
+ y = cy - r,
labels = labels || [];
dir = (dir && dir.toLowerCase && dir.toLowerCase()) || "east";
var l = values[i].others ? (otherslabel || "Others") : labels[j];
chart.labels.push(paper.set());
- chart.labels[i].push(paper[mark](x + 5, h, 5).attr({ fill: colors[i] || chartinst.colors[i], stroke: "none" }));
+ chart.labels[i].push(paper[mark](x + 5, y, 5).attr({ fill: colors[i] || chartinst.colors[i], stroke: "none" }));
chart.labels[i].push(
- txt = paper.text(x + 20, h, l || values[i]).attr(chartinst.txtattr).attr({ fill: opts.legendcolor || "#000", "text-anchor": "start"}));
+ txt = paper.text(x + 20, y, l || values[i]).attr(chartinst.txtattr).attr({ fill: opts.legendcolor || "#000", "text-anchor": "start"}));
- h += txt.getBBox().height * 1.2;
+ y += txt.getBBox().height * 1.2;
}
var bb = chart.labels.getBBox(),