Hit test in charts refers to the ability to fetch information about the chart object under the mouse and lets you create interactive applications. For instance, this feature can be used for displaying a special custom tooltip when mouse hovers over a particular data point. Similarly, you can even use the hit test information for drilling down the chart data, to set alerts and enable other user interaction functionalities.
FlexChart provides HitTest method through FlexChart class to fetch information about the underlying chart objects. This method has following two overloads and returns an object of the HitTestInfo class which provides information such as chart element under pointer, distance from the closest data point, index of the nearest data point etc.
To use this method to fetch information, you need to subscribe to a mouse event on which you want to fetch the information and then invoke the HitTest method in its event handler. You can then use this information in the required manner. In the example shown in this topic, we have fetched the information of chart objects on mouse movement and have displayed it in the information panel below the chart.