Category / Section
How to get a data point value from the chart series in ASP.NET MVC Chart?
1 min read
You can get the information related to a point in series when moving mouse over the point or by clicking the point using PointRegionMouseMove or PointRegionClick event.
Point region mouse move
PointRegionMouseMove event is triggered when you move mouse over a point.
Point region click
PointRegionClick event is triggered when you click a point.
CSHTML
@(Html.EJ().Chart("container") .PointRegionClick("mousemove") .PointRegionMouseMove("mousemove") )) <script type="text/javascript"> //Event handler for mouse move and mouse click function mousemove(sender) { series = sender.model.series[sender.data.region.SeriesIndex]; var X = series.points[sender.data.region.Region.PointIndex].x; var Y = series.points[sender.data.region.Region.PointIndex].y; alert("X:" + X + " Y:" + Y); } </script>