registerOverlay(overlay)
registerOverlay
用于自定义覆盖物。
参考
typescript
(
overlay: {
name: string
totalStep?: number
lock?: boolean
visible?: boolean
zLevel?: number
needDefaultPointFigure?: boolean
needDefaultXAxisFigure?: boolean
needDefaultYAxisFigure?: boolean
mode?: 'normal' | 'weak_magnet' | 'strong_magnet'
modeSensitivity?: number
points?: Array<{ timestamp: number, dataIndex?: number, value?: number }>
extendData?: any
styles?: object
createPointFigures?: (params: object) => {
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
} | Array<{
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
}>
createXAxisFigures?: (params: object) => {
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
} | Array<{
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
}>
createYAxisFigures?: (params: object) => {
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
} | Array<{
key?: string
type: string
attrs: any | any[]
styles?: any
ignoreEvent?: boolean | OverlayFigureIgnoreEventType[]
}>
performEventPressedMove?: (params: object) => void
performEventMoveForDrawing?: (params: object) => void
onDrawStart?: (event: object) => boolean
onDrawing?: (event: object) => boolean
onDrawEnd?: (event: object) => boolean
onClick?: (event: object) => boolean
onDoubleClick?: (event: object) => boolean
onRightClick?: (event: object) => boolean
onPressedMoveStart?: (event: object) => boolean
onPressedMoving?: (event: object) => boolean
onPressedMoveEnd?: (event: object) => boolean
onMouseEnter?: (event: object) => boolean
onMouseLeave?: (event: object) => boolean
onRemoved?: (event: object) => boolean
onSelected?: (event: object) => boolean
onDeselected?: (event: object) => boolean
}
) => void
参数
overlay
覆盖物配置。name
名称,用于创建或者修改的唯一标识。totalStep
总的实现步骤。lock
是否锁定不让拖动。visible
是否可见。zLevel
绘制层级,值越大,越靠前显示,只作用于覆盖物之间。needDefaultPointFigure
是否需要默认的点对应的图形。needDefaultXAxisFigure
是否需要默认的x轴上的图形。needDefaultYAxisFigure
是否需要默认的y轴上的图形。mode
模式,支持normal
,weak_magnet
和strong_magnet
。modeSensitivity
模式灵敏度,仅 mode 是weak_magnet
时有效。points
点信息。extendData
自定义扩展数据。styles
样式配置。createPointFigures
创建点对应的图形。createXAxisFigures
创建x轴上的图形。createYAxisFigures
创建y轴上的图形。performEventPressedMove
按住移动事件特殊处理方法。performEventMoveForDrawing
移动事件过程中特殊处理方法。onDrawStart
开始绘制事件。onDrawing
绘制中事件。onDrawEnd
绘制结束事件。onClick
点击事件。onDoubleClick
双击事件。onRightClick
右击事件。onPressedMoveStart
按住开始移动事件。onPressedMoving
按住移动中事件。onPressedMoveEnd
按住移动结束事件。onMouseEnter
鼠标移入事件。onMouseLeave
鼠标移出事件。onRemoved
删除事件。onSelected
选中事件。onDeselected
取消选中事件。
返回值
registerOverlay
返回 undefined
。