Fixed legend scale

This commit is contained in:
neveldo
2014-10-21 22:44:56 +02:00
parent 3532e07e43
commit 26aaa5ccf7
+6 -6
View File
@@ -576,8 +576,8 @@
legendOptions.slices[i].url legendOptions.slices[i].url
, legendOptions.marginLeft , legendOptions.marginLeft
, height , height
, legendOptions.slices[i].attrs.width , scale * legendOptions.slices[i].attrs.width
, legendOptions.slices[i].attrs.height , scale * legendOptions.slices[i].attrs.height
).attr(legendOptions.slices[i].attrs); ).attr(legendOptions.slices[i].attrs);
} else { } else {
elem = paper.circle( elem = paper.circle(
@@ -590,13 +590,13 @@
elemBBox = elem.getBBox(); elemBBox = elem.getBBox();
label = paper.text( label = paper.text(
legendOptions.marginLeft + scale * elemBBox.width + legendOptions.marginLeftLabel legendOptions.marginLeft + elemBBox.width + legendOptions.marginLeftLabel
, height + scale * (elemBBox.height / 2) , height + (elemBBox.height / 2)
, legendOptions.slices[i].label , legendOptions.slices[i].label
).attr(legendOptions.labelAttrs); ).attr(legendOptions.labelAttrs);
width = Math.max(width, legendOptions.marginLeft + scale * elemBBox.width + legendOptions.marginLeftLabel + label.getBBox().width); width = Math.max(width, legendOptions.marginLeft + elemBBox.width + legendOptions.marginLeftLabel + label.getBBox().width);
height += legendOptions.marginBottom + scale * elemBBox.height; height += legendOptions.marginBottom + elemBBox.height;
if (legendOptions.hideElemsOnClick.enabled) { if (legendOptions.hideElemsOnClick.enabled) {
// Hide/show elements when user clicks on a legend element // Hide/show elements when user clicks on a legend element