# Interface: LegendElement<TType>
# Type parameters
| Name | Type |
|---|---|
TType | extends ChartType |
# Hierarchy
default<AnyObject,LegendOptions<TType>>-
↳
LegendElement
# Properties
# $animations
• $animations: Record<string, Animation>
# Inherited from
Element.$animations
# Defined in
core/core.element.ts:15
# active
• active: boolean = false
# Inherited from
Element.active
# Defined in
core/core.element.ts:13
# bottom
• bottom: number
Bottom edge of the item. Set by layout system and cannot be used in update
# Inherited from
# Defined in
types/layout.d.ts:41
# chart
• chart: Chart<TType, DistributiveArray<ChartTypeRegistry[TType]["defaultDataPoint"]>, unknown>
# Defined in
types/index.d.ts:2370
# ctx
• ctx: CanvasRenderingContext2D
# Defined in
types/index.d.ts:2371
# fullSize
• fullSize: boolean
if true, and the item is horizontal, then push vertical boxes down
# Inherited from
# Defined in
types/layout.d.ts:17
# height
• height: number
Height of item. Must be valid after update()
# Inherited from
# Defined in
types/layout.d.ts:25
# left
• left: number
Left edge of the item. Set by layout system and cannot be used in update
# Inherited from
# Defined in
types/layout.d.ts:29
# legendItems
• Optional legendItems: LegendItem[]
# Defined in
types/index.d.ts:2372
# options
• options: LegendOptions<TType>
# Overrides
Element.options
# Defined in
types/index.d.ts:2373
# position
• position: LayoutPosition
The position of the item in the chart layout. Possible values are
# Inherited from
# Defined in
types/layout.d.ts:9
# right
• right: number
Right edge of the item. Set by layout system and cannot be used in update
# Inherited from
# Defined in
types/layout.d.ts:37
# top
• top: number
Top edge of the item. Set by layout system and cannot be used in update
# Inherited from
# Defined in
types/layout.d.ts:33
# weight
• weight: number
The weight used to sort the item. Higher weights are further away from the chart area
# Inherited from
# Defined in
types/layout.d.ts:13
# width
• width: number
Width of item. Must be valid after update()
# Inherited from
# Defined in
types/layout.d.ts:21
# x
• x: number
# Inherited from
Element.x
# Defined in
core/core.element.ts:11
# y
• y: number
# Inherited from
Element.y
# Defined in
core/core.element.ts:12
# Methods
# beforeLayout
▸ Optional beforeLayout(): void
Called before the layout process starts
# Returns
void
# Inherited from
# Defined in
types/layout.d.ts:46
# draw
▸ draw(chartArea): void
Draws the element
# Parameters
| Name | Type |
|---|---|
chartArea | ChartArea |
# Returns
void
# Inherited from
# Defined in
types/layout.d.ts:50
# fit
▸ fit(): void
# Returns
void
# Defined in
types/index.d.ts:2374
# getPadding
▸ Optional getPadding(): ChartArea
Returns an object with padding on the edges
# Returns
# Inherited from
# Defined in
types/layout.d.ts:54
# getProps
▸ getProps<P>(props, final?): Pick<AnyObject, P[number]>
Gets the current or final value of each prop. Can return extra properties (whole object).
# Type parameters
| Name | Type |
|---|---|
P | extends string[] |
# Parameters
| Name | Type | Description |
|---|---|---|
props | P | properties to get |
final? | boolean | get the final value (animation target) |
# Returns
Pick<AnyObject, P[number]>
# Inherited from
Element.getProps
# Defined in
core/core.element.ts:31
▸ getProps<P>(props, final?): Partial<Record<P, unknown>>
# Type parameters
| Name | Type |
|---|---|
P | extends string |
# Parameters
| Name | Type |
|---|---|
props | P[] |
final? | boolean |
# Returns
Partial<Record<P, unknown>>
# Inherited from
Element.getProps
# Defined in
core/core.element.ts:32
# hasValue
▸ hasValue(): boolean
# Returns
boolean
# Inherited from
Element.hasValue
# Defined in
core/core.element.ts:22
# isHorizontal
▸ isHorizontal(): boolean
returns true if the layout item is horizontal (ie. top or bottom)
# Returns
boolean
# Inherited from
# Defined in
types/layout.d.ts:58
# tooltipPosition
▸ tooltipPosition(useFinalPosition): Point
# Parameters
| Name | Type |
|---|---|
useFinalPosition | boolean |
# Returns
# Inherited from
Element.tooltipPosition
# Defined in
core/core.element.ts:17
# update
▸ update(width, height, margins?): void
Takes two parameters: width and height.
# Parameters
| Name | Type |
|---|---|
width | number |
height | number |
margins? | ChartArea |
# Returns
void
# Inherited from
# Defined in
types/layout.d.ts:64