showAt(Mixed value)

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


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

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

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

Note:
  • 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
     },
     .
   },
 .
 .
});
chart.render();

chart.axisX[0].crosshair.showAt(20);


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.




In order to provide better support, we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.