# 接口:LineElement<T, O>
# 类型参数
| 名称 | 类型 |
|---|---|
T | 继承自 LineProps = LineProps |
O | 继承自 LineOptions = LineOptions |
# 层次结构
default<T,O>-
↳
LineElement
# 属性
# $animations
• $animations: Record<keyof T, Animation>
# 继承自
Element.$animations
# 定义于
core/core.element.ts:15 (opens new window)
# active
• active: boolean = false
# 继承自
Element.active
# 定义于
core/core.element.ts:13 (opens new window)
# options
• options: O
# 继承自
Element.options
# 定义于
core/core.element.ts:14 (opens new window)
# points
• points: Point[]
# 定义于
types/index.d.ts:1954 (opens new window)
# segments
• Readonly segments: Segment[]
# 定义于
# x
• x: number
# 继承自
Element.x
# 定义在
core/core.element.ts:11(打开新窗口)
# y
• y: number
# 继承自
Element.y
# 定义在
core/core.element.ts:12(打开新窗口)
# 方法
# draw
▸ draw(ctx, area?): void
# 参数
| 名称 | 类型 |
|---|---|
ctx | CanvasRenderingContext2D |
area? | ChartArea |
# 返回值
void
# 继承自
# 定义在
# first
▸ first(): false | Point
# 返回值
false | Point
# 定义在
# getCenterPoint
▸ getCenterPoint(useFinalPosition?): Point
# 参数
| 名称 | 类型 |
|---|---|
useFinalPosition? | boolean |
# 返回值
# 继承自
# 定义在
types/index.d.ts:1800 (在新窗口中打开)
# getProps
▸ getProps<P>(props, final?): Pick<T, P[number]>
获取每个属性当前或最终的值。可以返回额外属性(整个对象)。
# 类型参数
| 名称 | 类型 |
|---|---|
P | extends keyof T[] |
# 参数
| 名称 | 类型 | 描述 |
|---|---|---|
props | P | 要获取的属性 |
final? | boolean | 获取最终值(动画目标) |
# 返回值
Pick<T, 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 (在新窗口中打开)
# getRange
▸ Optional getRange(axis): number
# 参数
| 名称 | 类型 |
|---|---|
axis | "x" | "y" |
# 返回值
number
# 从
# 定义于
types/index.d.ts:1801 (在新窗口中打开)
# hasValue
▸ hasValue(): boolean
# 返回值
boolean
# 从
Element.hasValue
# 定义于
core/core.element.ts:22 (在新窗口中打开)
# inRange
▸ inRange(mouseX, mouseY, useFinalPosition?): boolean
# 参数
| 名称 | 类型 |
|---|---|
mouseX | number |
mouseY | number |
useFinalPosition? | boolean |
# 返回值
boolean
# 继承自
# 定义于
types/index.d.ts:1797 (在新窗口中打开)
# inXRange
▸ inXRange(mouseX, useFinalPosition?): boolean
# 参数
| 名称 | 类型 |
|---|---|
mouseX | number |
useFinalPosition? | boolean |
# 返回值
boolean
# 继承自
# 定义于
types/index.d.ts:1798 (在新窗口中打开)
# inYRange
▸ inYRange(mouseY, useFinalPosition?): boolean
# 参数
| 名称 | 类型 |
|---|---|
mouseY | number |
useFinalPosition? | boolean |
# 返回值
boolean
# 继承自
# 定义于
types/index.d.ts:1799 (在新窗口中打开)
# interpolate
▸ interpolate(point, property): Point | Point[]
# 参数
| 名称 | 类型 |
|---|---|
point | Point |
property | "x" | "y" |
# 返回值
# 定义于
types/index.d.ts:1958 (在新窗口中打开)
# last
▸ last(): false | Point
# 返回值
false | Point
定义于
types/index.d.ts:1957 (在新窗口中打开)
路径
▸ path(ctx): boolean
参数
| 名称 | 类型 |
|---|---|
ctx | CanvasRenderingContext2D |
返回值
boolean
定义于
types/index.d.ts:1960 (在新窗口中打开)
pathSegment
▸ pathSegment(ctx, segment, params): boolean
参数
| 名称 | 类型 |
|---|---|
ctx | CanvasRenderingContext2D |
segment | 线段 |
params | AnyObject |
返回值
boolean
定义于
types/index.d.ts:1959 (在新窗口中打开)
tooltipPosition
▸ tooltipPosition(useFinalPosition): Point
参数
| 名称 | 类型 |
|---|---|
useFinalPosition | boolean |
返回值
继承自
Element.tooltipPosition
定义于
core/core.element.ts:17 (在新窗口中打开)
updateControlPoints
▸ updateControlPoints(chartArea, indexAxis?): void
参数
| 名称 | 类型 |
|---|---|
chartArea | ChartArea |
indexAxis? | "x" | "y" |
返回值
void