Skip to content

convertFromPixel(coordinate, finder?) ​

convertFromPixel convert coordinates to values.

Reference ​

typescript
(
  coordinate: {
    x?: number
    y?: number
  } | Array<{
    x?: number
    y?: number
  },
  finder?: {
    paneId?: string
    absolute?: boolean
  }
) => {
    dataIndex?: number
    timestamp?: number
    value?: number
  } | Array<{
    dataIndex?: number
    timestamp?: number
    value?: number
  }>

Parameters ​

  • coordinate The coordinates to be converted can be an object or an array.
    • x The x-axis value.
    • y The y-axis value.
  • finder Filter conditions.
    • paneId Pane id.
    • absolute Whether it is an absolute coordinate, only applies to the y-axis.

Returns ​

convertFromPixel returns { timestamp?: number, dataIndex?: number, value?: number } or Array<{ timestamp?: number, dataIndex?: number, value?: number }> .

Usage ​

Basic usage ​