#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# VerticalLegendLayout Class

Defined in: `charts/js/CartesianChartLegend.js:207`
Module: charts-legend
Parent Module: charts

Contains methods for displaying items vertically in a legend.

- Index
- Methods

## Item Index

### Methods

- _getLayoutDimensions
- _positionLegendItems
- _redraw
- _setColumnArrays
- destructor
- getStartPoint

## Methods

### `_getLayoutDimensions`

() Object protected

Defined in `charts/js/CartesianChartLegend.js:661`

Positions the legend in a chart and returns the properties of the legend to be used in the chart's layout algorithm.

#### Returns:

Object: The left, top, right and bottom values for the legend.

### `_positionLegendItems`

(

- `items`
- `maxWidth`
- `maxHeight`
- `totalWidth`
- `totalHeight`
- `padding`
- `horizontalGap`
- `verticalGap`
- `vAlign`

)
protected

Defined in `charts/js/CartesianChartLegend.js:215`

Displays items vertically in a legend.

#### Parameters:

- `items` Array

  Array of items to display in the legend.

- `maxWidth` Number

  The width of the largest item in the legend.

- `maxHeight` Number

  The height of the largest item in the legend.

- `totalWidth` Number

  The total width of all items in a legend.

- `totalHeight` Number

  The total height of all items in a legend.

- `padding` Number

  The left, top, right and bottom padding properties for the legend.

- `horizontalGap` Number

  The horizontal distance between items in a legend.

- `verticalGap` Number

  The vertical distance between items in a legend.

- `vAlign` String

  The vertical alignment of the legend.

### `_redraw`

() private

Defined in `charts/js/CartesianChartLegend.js:369`

Redraws and position all the components of the chart instance.

### `_setColumnArrays`

(

- `items`
- `limit`
- `verticalGap`

)
protected

Defined in `charts/js/CartesianChartLegend.js:294`

Creates column and total height arrays used for displaying multiple columns of legend items based on the items, available height and verticalGap for the legend.

#### Parameters:

- `items` Array

  Array of legend items to display in a legend.

- `limit` Number

  Total available height for displaying items in a legend.

- `verticalGap` Number

  Vertical distance between items in a legend.

### `destructor`

() protected

Defined in `charts/js/CartesianChartLegend.js:715`

Destructor implementation for the CartesianChart class. Calls destroy on all axes, series, legend (if available) and the Graph instance. Removes the tooltip and overlay HTML elements.

### `getStartPoint`

(

- `h`
- `totalHeight`
- `align`
- `padding`

)
protected

Defined in `charts/js/CartesianChartLegend.js:338`

Returns the starting y-coordinate for a column of legend items.

#### Parameters:

- `h` Number

  Height of the legend.

- `totalHeight` Number

  Total height of all labels in the column.

- `align` String

  Vertical alignment of items for the legend.

- `padding` Object

  Object contain left, top, right and bottom padding properties.

#### Returns:

Number