mirror of https://github.com/vitalif/dimple
Allow increasing the space between legend entries
This is achieved by allowing the attributes `horizontalPadding` and `verticalPadding` to be overridden.master
parent
c1a884e327
commit
6ee4453a2d
|
@ -68,8 +68,8 @@
|
|||
|
||||
// Expand the bounds of the largest shape slightly. This will be the size allocated to
|
||||
// all elements
|
||||
maxHeight = (maxHeight < keyHeight ? keyHeight : maxHeight) + 2;
|
||||
maxWidth += keyWidth + 20;
|
||||
maxHeight = (maxHeight < keyHeight ? keyHeight : maxHeight) + self._getVerticalPadding();
|
||||
maxWidth += keyWidth + self._getHorizontalPadding();
|
||||
|
||||
// Iterate the shapes and position them based on the alignment and size of the legend
|
||||
theseShapes
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright: 2015 PMSI-AlignAlytics
|
||||
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
|
||||
// Source: /src/objects/legend/methods/_getHorizontalPadding.js
|
||||
this._getHorizontalPadding = function () {
|
||||
var horizontalPadding;
|
||||
if (isNaN(this.horizontalPadding)) {
|
||||
horizontalPadding = 20;
|
||||
} else {
|
||||
horizontalPadding = this.horizontalPadding;
|
||||
}
|
||||
return horizontalPadding;
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright: 2015 PMSI-AlignAlytics
|
||||
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
|
||||
// Source: /src/objects/legend/methods/_getVerticalPadding.js
|
||||
this._getVerticalPadding = function () {
|
||||
var verticalPadding;
|
||||
if (isNaN(this.verticalPadding)) {
|
||||
verticalPadding = 2;
|
||||
} else {
|
||||
verticalPadding = this.verticalPadding;
|
||||
}
|
||||
return verticalPadding;
|
||||
};
|
Loading…
Reference in New Issue