Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get all subgraph data for a specified coordinate #6500

Closed
wanghe199512 opened this issue Feb 26, 2023 · 3 comments
Closed

How to get all subgraph data for a specified coordinate #6500

wanghe199512 opened this issue Feb 26, 2023 · 3 comments

Comments

@wanghe199512
Copy link

wanghe199512 commented Feb 26, 2023

I built multiple subgraphs, using click or hover on one subgraph, and how to use this coordinate to get data from other subgraphs(Click or use hover on a subgraph to get all the data for the other subgraphs at that coordinates)

myplot. On (' plotly' , function (eventdata){
// currently eventdata has only one subgraph data
}

example :https://codepen.io/wanghe199512/pen/XWPNbxJ

image

thanks

@Coding-with-Adam
Copy link
Contributor

Coding-with-Adam commented Feb 28, 2023

Email from @wanghe199512 :

only one can be obtained now, as shown below:

image

Hovering over the graph pointed by the arrow returned two pieces of data, and my request was: return the data from the other graphs as well.


In the subgraph mode, I think this is better and more flexible. Echarts can do this

image

@alexcjohnson
Copy link
Collaborator

A full solution to this issue would be best done as a hovermode that spans subplots - proposed long ago and lots of 👍 but hasn't bubbled up to the top #2114

Meantime, if your traces all have the same x data it's pretty easy to get all the corresponding y values inside the event handler because they'll be at the same position in the data arrays - look at points[0].pointNumber, then you can do something like:

const yVals = myplot.data.map(trace=> trace.y[eventdata.points[0].pointNumber])

@gvwilson gvwilson self-assigned this Jul 4, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson
Copy link
Contributor

gvwilson commented Aug 9, 2024

Hi - we are tidying up issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. For tech support and "how-to" questions, please post in our community forum https://community.plotly.com/. Thank you - @gvwilson

@gvwilson gvwilson closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants