# Get coordinated when working with multiple traces

**URL:** <https://community.plotly.com/t/get-coordinated-when-working-with-multiple-traces/32207>\
**Category:** plotly.js\
**Created:** [December 5, 2019, 10:59am UTC](https://community.plotly.com/t/get-coordinated-when-working-with-multiple-traces/32207 "2019-12-05T10:59:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrutiPlot](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shrutiPlot](https://community.plotly.com/u/shrutiPlot)\
**Post date:** [December 5, 2019, 10:59am UTC](https://community.plotly.com/t/get-coordinated-when-working-with-multiple-traces/32207/1 "2019-12-05T10:59:16Z")

</div>

I have made a scatterplot using Plotlyjs with 4 traces, so the data looks like this:

![data](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/9/93605a580bb7aaf82244eba3804a01f136971455.png)

Now I want y coordinate when the user clicks on the chart, how should I approach this, I tried using for loop with “plotly\_click”, but I am getting wrong values with it. Can you guys help me here

for (var i=0; i\<data.points.length; i++){  
selectedPoint = 'y axis value is= '+data.points[i].y;  
}

This loop always gives me the value of the last trace and is not showing the value of any other trace.
