get(String propertyName)

Returns the specified property of crosshair.

        propertyName: Name of the property

Example: chart.axisX[0].crosshair.get(“color”);

  • Chart should be rendered before you can use get method.

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


Properties accessible via get method

Please refer to crosshair element for the complete list of properties that can be accessed via get method.

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.