Attached you find a demonstrator project.
It does what you want, but only for one graph.
It is easy to make it for two graphs, working with arrays.
If you want, I can do it for you.
I suppose that your project is dedicated for tablets only.
I developped this project on a phone.
View attachment 63255