# Hit-Testing in FlexChart

Learn how to do hit-testing in Wijmo's FlexChart to determine which area of the chart was clicked in this documentation topic

## Content

You can use the _hitTest_ method to determine what chart area is under the mouse. Call the _hitTest_ method within a mouse event such as mousemove, mouseover, or mouseup.

```JavaScript
 myChart.hostElement.addEventListener('mousemove', function (e) {
     // get hittest object
     var ht = myChart.hitTest(e);
     // get chart element
     var elem = ht.chartElement;
     // get series
     var series = ht.series;
     // get point index
     var index = (ht.pointIndex != null && series) ? ht.pointIndex : null;
     });
```
The _hitTest_ method takes the point as a parameter. The chart elements you can obtain from the hit test are:

* __PlotArea__: The area within the axes.
* __ChartArea__: The area within the control but outside the axes.
* __Legend__: The chart legend, usually on the right of the plot area.
* __Header__: The chart header, above the plot area.
* __Footer__: The chart footer, below the plot area.
* __AxisX__: The X-axis, usually horizontal.
* __AxisY__: The Y-axis, usually vertical.
* __Series__: A collection of __Series__ objects that can be used to customize the chart. The FlexChart populates the series collections automatically based on the chart's __itemsSource__.
* __SeriesSymbol__: A symbol in a chart series.
* __DataLabel__: A label attached to a data point.
