Skip to content

registerOverlay(overlay) ​

registerOverlay used to custom overlay.

Reference ​

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

Parameters ​

  • overlay Overlay configuration.
    • name Name, a unique identifier used for creation or modification.
    • totalStep Total implementation steps.
    • lock Whether to lock and prevent dragging.
    • visible Whether it is visible.
    • zLevel Drawing level, the larger the value, the closer it is displayed to the front, and it only works between the overlays.
    • needDefaultPointFigure Whether the default point corresponding figures are required.
    • needDefaultXAxisFigure Whether to use the default x-axis for the figure.
    • needDefaultYAxisFigureWhether to use the default y-axis for the figure.
    • mode Mode, supports normal , weak_magnet and strong_magnet .
    • modeSensitivity Mode sensitivity, only valid when mode is weak_magnet .
    • points Point information.
    • extendData Custom the extend data.
    • styles Style configuration.
    • createPointFigures Create figures corresponding to the points.
    • createXAxisFigures Create figures corresponding to the x-axis.
    • createYAxisFigures Create figures corresponding to the y-axis.
    • performEventPressedMove Special processing method for press and hold movement events.
    • performEventMoveForDrawing Special processing methods during mobile events.
    • onDrawStart Start drawing event.
    • onDrawing Drawing event.
    • onDrawEnd Drawing end event.
    • onClick Click event.
    • onDoubleClick Double click event.
    • onRightClick Right click event.
    • onPressedMoveStart Press and hold to start moving the event.
    • onPressedMoving Press and hold the moving event.
    • onPressedMoveEnd Press and hold to end the move event.
    • onMouseEnter Mouse enter event.
    • onMouseLeave Mouse leave event.
    • onRemoved Delete event.
    • onSelected Select the event.
    • onDeselected Deselect the event.

Returns ​

registerOverlay returns undefined .

Usage ​

Basic usage ​

Using custom figure ​