Interface: LegendElement<TType>

    Readonly active: boolean

    Inherited from

    Element.active

    Defined in


    bottom

    bottom: number

    Bottom edge of the item. Set by layout system and cannot be used in update

    Inherited from

    LayoutItem.

    Defined in


    chart

    chart: <TType, DistributiveArray<ChartTypeRegistry[TType]["defaultDataPoint"]>, unknown>

    Defined in

    index.esm.d.ts:2184 (opens new window)


    ctx

    ctx: CanvasRenderingContext2D

    Defined in


    fullSize

    fullSize: boolean

    if true, and the item is horizontal, then push vertical boxes down

    Inherited from

    LayoutItem.

    Defined in


    height

    height: number

    Height of item. Must be valid after update()

    Inherited from

    LayoutItem.

    Defined in


    left

    left: number

    Left edge of the item. Set by layout system and cannot be used in update

    Inherited from

    LayoutItem.

    Defined in


    legendItems

    Optional legendItems: []

    Defined in


    options: LegendOptions<TType>

    Overrides

    Element.options

    Defined in


    position

    The position of the item in the chart layout. Possible values are

    Inherited from

    LayoutItem.

    Defined in


    right

    right: number

    Right edge of the item. Set by layout system and cannot be used in update

    Inherited from

    LayoutItem.

    Defined in


    top

    top: number

    Top edge of the item. Set by layout system and cannot be used in update

    Inherited from

    LayoutItem.

    Defined in


    weight

    weight: number

    The weight used to sort the item. Higher weights are further away from the chart area

    Inherited from

    LayoutItem.

    Defined in


    width

    width: number

    Width of item. Must be valid after update()

    Inherited from

    LayoutItem.

    Defined in


    x

    x: number

    Inherited from

    Element.x

    Defined in


    y

    Readonly y: number

    Inherited from

    Element.y

    Defined in

    Optional beforeLayout(): void

    Called before the layout process starts

    Returns

    void

    Inherited from

    LayoutItem.

    Defined in


    draw

    Draws the element

    Parameters

    NameType
    chartAreaChartArea

    Returns

    void

    Inherited from

    .draw

    Defined in

    layout.d.ts:50LegendElement - 图18 (opens new window)


    getPadding

    Optional getPadding(): ChartArea

    Returns an object with padding on the edges

    Returns

    ChartArea

    Inherited from

    LayoutItem.

    Defined in


    getProps

    getProps<P>(props, final?): Pick<AnyObject, P[number]>

    Type parameters

    Parameters

    NameType
    props
    final?boolean

    Returns

    Pick<AnyObject, P[number]>

    Inherited from

    Element.getProps

    Defined in

    element.d.ts:12LegendElement - 图20 (opens new window)


    hasValue

    hasValue(): boolean

    Returns

    boolean

    Inherited from

    Element.hasValue

    Defined in


    isHorizontal

    isHorizontal(): boolean

    returns true if the layout item is horizontal (ie. top or bottom)

    Returns

    boolean

    Inherited from

    .isHorizontal

    Defined in

    layout.d.ts:58LegendElement - 图22 (opens new window)


    tooltipPosition

    tooltipPosition(useFinalPosition?): Point

    Parameters

    Returns

    Inherited from

    Element.tooltipPosition

    Defined in

    element.d.ts:10 (opens new window)


    update

    update(width, height, margins?): void

    Takes two parameters: width and height.

    Parameters

    NameType
    widthnumber
    heightnumber

    Returns

    void

    Inherited from

    LayoutItem.

    Defined in