mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 08:03:30 +02:00
Fixed legend scale
This commit is contained in:
+6
-6
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user