HorizontalLegendLayout Class
Contains methods for displaying items horizontally in a legend.
Item Index
Methods
_positionLegendItems
-
items -
maxWidth -
maxHeight -
totalWidth -
totalHeight -
padding -
horizontalGap -
verticalGap -
hAlign -
vAlign
Displays items horizontally in a legend.
Parameters:
-
itemsArrayArray of items to display in the legend.
-
maxWidthNumberThe width of the largest item in the legend.
-
maxHeightNumberThe height of the largest item in the legend.
-
totalWidthNumberThe total width of all items in a legend.
-
totalHeightNumberThe total height of all items in a legend.
-
paddingNumberThe left, top, right and bottom padding properties for the legend.
-
horizontalGapNumberThe horizontal distance between items in a legend.
-
verticalGapNumberThe vertical distance between items in a legend.
-
hAlignStringThe horizontal alignment of the legend.
-
vAlignStringThe vertical alignment of the legend.
_setRowArrays
-
items -
limit -
horizontalGap
Creates row and total width arrays used for displaying multiple rows of legend items based on the items, available width and horizontalGap for the legend.
Parameters:
-
itemsArrayArray of legend items to display in a legend.
-
limitNumberTotal available width for displaying items in a legend.
-
horizontalGapNumberHorizontal distance between items in a legend.
getStartPoint
-
w -
totalWidth -
align -
padding
Returns the starting x-coordinate for a row of legend items.
Parameters:
-
wNumberWidth of the legend.
-
totalWidthNumberTotal width of all labels in the row.
-
alignStringHorizontal alignment of items for the legend.
-
paddingObjectObject contain left, top, right and bottom padding properties.
