Home Forums Chart Support X-axis click event Reply To: X-axis click event



You can bind mouse events to the chart container and get mouse coordinates in pixels, which can be converted to corresponding values along the axis using convertPixelToValue as shown in this documentation page. Please take a look at the code snippet below:

	var parentOffset = $(this).parent().offset();
	var relX = e.pageX - parentOffset.left;
	var xValue = Math.round(chart.axisX[0].convertPixelToValue(relX));

Thangaraj Raman
Team CanvasJS