Re-factoring the tooltip function for scatter chart.

 Earlier, there is a seperate function for handling overlapped tooltip. Merged with the common changes