showAt(Mixed value)

Shows crosshair at the specified value on respective axis, when crosshair is enabled.

        value: value at which crosshair has to be shown. Value can be a number, timestamp or dateTime object.

        Boolean: Returns true if the operation was successful. Else returns false.

Example: chart.axisX[0].crosshair.showAt(10);

  • Chart should be rendered before you can use showAt method.
  • showAt method can be used to sync crosshair across multiple charts present in a single page.

var chart = new CanvasJS.Chart("container",
   axisX: {
     crosshair: {
       enabled: true


Try it Yourself by Editing the Code below.

Syncing Crosshair

Below is an example showing synchronizing crosshair across multiple charts.

Try it Yourself by Editing the Code below.

If you have any questions, please feel free to ask in our forums.Ask Question