# 介面:LegendElement<TType>
# 類型參數
名稱 | 類型 |
---|---|
TType | 繼承 ChartType |
# 繼承層級
default
<AnyObject
,LegendOptions
<TType
>>-
↳
LegendElement
# 屬性
# $animations
• $animations: Record
<string
, Animation
>
# 繼承自
Element.$animations
# 定義於
core/core.element.ts:15 (在新視窗中開啟)
# active
• active: boolean
= false
# 繼承自
Element.active
# 定義於
core/core.element.ts:13 (在新視窗中開啟)
# bottom
• bottom: number
項目的底部邊緣。由佈局系統設定,無法在更新中使用
# 繼承自
# 定義於
types/layout.d.ts:41 (在新視窗中開啟)
# chart
• chart: Chart
<TType
, DistributiveArray
<ChartTypeRegistry
[TType
]["defaultDataPoint"
]>, unknown
>
# 定義於
types/index.d.ts:2343 (在新視窗中開啟)
# ctx
• ctx: CanvasRenderingContext2D
# 定義於
types/index.d.ts:2344 (在新視窗中開啟)
# fullSize
• fullSize: boolean
如果為 true,且項目為水平,則將垂直方塊向下推
# 繼承自
# 定義於
types/layout.d.ts:17 (在新視窗中開啟)
# height
• height: number
項目高度。在 update() 之後必須有效
# 繼承自
# 定義於
types/layout.d.ts:25 (在新視窗中開啟)
# left
• left: number
項目的左邊緣。由佈局系統設定,無法在更新中使用
# 繼承自
# 定義於
types/layout.d.ts:29 (在新視窗中開啟)
# legendItems
• Optional
legendItems: LegendItem
[]
# 定義於
types/index.d.ts:2345 (在新視窗中開啟)
# options
• options: LegendOptions
<TType
>
# 覆寫
Element.options
# 定義於
# position
• position: LayoutPosition
圖表佈局中項目(item)的位置。可能的值為:
# 繼承自
# 定義於
# right
• right: number
項目的右邊緣。由佈局系統設定,不能在更新中使用
# 繼承自
# 定義於
# top
• top: number
項目的上邊緣。由佈局系統設定,不能在更新中使用
# 繼承自
# 定義於
# weight
• weight: number
用於排序項目的權重。權重越高,離圖表區域越遠
# 繼承自
# 定義於
# width
• width: number
項目的寬度。在 update() 之後必須有效
# 繼承自
# 定義於
# x
• x: number
# 繼承自
Element.x
# 定義於
core/core.element.ts:11 (開啟新視窗)
# y
• y: number
# 繼承自
Element.y
# 定義於
core/core.element.ts:12 (開啟新視窗)
# 方法
# beforeLayout
▸ Optional
beforeLayout(): void
在佈局過程開始之前調用
# 返回
void
# 繼承自
# 定義於
# draw
▸ draw(chartArea
): void
繪製元素
# 參數
名稱 | 類型 |
---|---|
chartArea | ChartArea |
# 返回
void
# 繼承自
# 定義於
# getPadding
▸ Optional
getPadding(): ChartArea
返回一個包含邊緣填充的物件
# 返回
# 繼承自
# 定義於
# getProps
▸ getProps<P
>(props
, final?
): Pick
<AnyObject
, P
[number
]>
取得每個屬性的當前或最終值。可以返回額外的屬性(整個物件)。
# 類型參數
名稱 | 類型 |
---|---|
P | extends string [] |
# 參數
名稱 | 類型 | 描述 |
---|---|---|
props | P | 要取得的屬性 |
final? | boolean | 取得最終值(動畫目標) |
# 返回
Pick
<AnyObject
, P
[number
]>
# 繼承自
Element.getProps
# 定義於
core/core.element.ts:31 (開啟新視窗)
▸ getProps<P
>(props
, final?
): Partial
<Record
<P
, unknown
>>
# 類型參數
名稱 | 類型 |
---|---|
P | extends string |
# 參數
名稱 | 類型 |
---|---|
props | P [] |
final? | boolean |
# 返回
Partial
<Record
<P
, unknown
>>
# 繼承自
Element.getProps
# 定義於
core/core.element.ts:32 (開啟新視窗)
# hasValue
▸ hasValue(): boolean
# 返回
boolean
# 繼承自
Element.hasValue
# 定義於
core/core.element.ts:22 (在新視窗開啟)
# isHorizontal
▸ isHorizontal(): boolean
如果版面項目是水平的 (例如:頂部或底部),則返回 true。
# 返回值
boolean
# 繼承自
# 定義於
# tooltipPosition
▸ tooltipPosition(useFinalPosition
): Point
# 參數
名稱 | 類型 |
---|---|
useFinalPosition | boolean |
# 返回值
# 繼承自
Element.tooltipPosition
# 定義於
core/core.element.ts:17 (在新視窗開啟)
# update
▸ update(width
, height
, margins?
): void
接收兩個參數:寬度和高度。
# 參數
名稱 | 類型 |
---|---|
width | number |
height | number |
margins? | ChartArea |
# 返回值
void
# 繼承自
# 定義於
← LayoutItem LegendItem →