How to get the bar number/time from OnChartEvent()?

 
In an Expert Advisor code, I would like to know on which bar of a chart the user clicked. From the example and documentation of OnChartEvent() function, a left click of mouse can be captured as a position (x, y). Is there a way to get the bar time/number on which the user left clicked?
 

ChartXYToTimePrice

then

iBarShift 

 
GumRai:

ChartXYToTimePrice

then

iBarShift 


Thanks!