Skip to content


Cursor keeps current XY-position of the crosshair, time, current scale values and the selected values of overlays (you can see them in the legend).

let chart = new NightVision()
// Example of a cursor object
    visible: true,
    gridId: 0,
    values: [
    x: 473.5,
    y: 213,
    scales: {
        A: 5.067736096938775
    t: 1663434000000

Syncing multiple cursors

You can set the cursor by assigning a new value, therefore can track a cursor of a different chart:

js"app:$cursor-update", (range) => {
    chart1.cursor = cursor;

See Basic Example #8 for the full implementation.

The following are useful methods of the cursor.

cursor.getValue(paneId, ovId)

  • Type: function
  • Arguments
    • paneId: number Pane id
    • ovId: number Overlay id
  • Returns Array Data element [<time>, <value1>, ...]

Returns a specific data value by Pane id and Overlay id. This is a short-cut for accessing values. You can also access them directly:

let value = chart.cursor.values[paneId][overlayId]

Released under the MIT License.