mouseover: Function

Sets the mouseover event handler for dataSeries which is triggered when user moves Mouse Over a dataSeries. Upon event, a parameter that contains event related data is sent to the assigned event handler. Parameter includes dataPoint and dataSeries corresponding to the event.


Default: null
Example:
mouseover: function(e){
  alert( e.dataSeries.type+ “, dataPoint { x:” + e.dataPoint.x + “, y: “+ e.dataPoint.y + ” }” );
  },

var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{

    mouseover: function(e){
     alert(  e.dataSeries.type+ ", dataPoint { x:" + e.dataPoint.x + ", y: "+ e.dataPoint.y + " }" );
    },

 },
]
 .
 .
});
chart.render();


Event Object

e:{ 
	x, 
	y,
        chart,
	dataPoint, 
	dataSeries, 
	dataPointIndex, 
	dataSeriesIndex
}



Try it Yourself by Editing the Code below.

  Also See:    



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.

Comments 7

  1. Change the example to area chart and test. It’s not working properly. The event fires randomly.

    • allan,

      We just tried doing the same and events are firing properly. Its firing most of the times because event handler has been set to both the series. We have removed one of the series from example so that easier to observe events firing on hover.

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.