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

Horizontal Highlight at touch/click point... ?? #1636

Closed
moon47usaco opened this issue Oct 10, 2016 · 7 comments
Closed

Horizontal Highlight at touch/click point... ?? #1636

moon47usaco opened this issue Oct 10, 2016 · 7 comments

Comments

@moon47usaco
Copy link

moon47usaco commented Oct 10, 2016

Is it possible to show the horizontal highlight of the point touched rather than sticking to the data at that selection point. What I am after is something like the below:

http://techanjs.org

Just a simple highlight on tap location would suffice for now.

Would this require complex customization of the highlighter?

@moon47usaco
Copy link
Author

As for getting a horizontal line at the mouse over point. It does not have to be mouse over as that may be impractical in a mobile view unless you disable other touch events like scrolling. Although a tap and hold to activate the movable highlight and temporarily disable other touch events would solve that. Then other events would be activated on tap and move.

Again those features are aside from the main functionality of getting a horizontal line where the user clicks rather than snap to the data point at that x location.

@danielgindi
Copy link
Collaborator

Please see the demos. Some of the examples have this kind of highlight on the values.

@moon47usaco
Copy link
Author

moon47usaco commented Oct 10, 2016

I do not see anything like that on the demos. Everything has a horizontal highlight that is snapped to the y value at that x position. That is not what I want. I would like the horizontal line to be wherever the user clicks/taps.

This is what I get if user clicks/taps at the red target.
demo

The green line is what I am after. I do not see that functionality in the demos.
demo2

If it is there and I am mistaken just point me to the correct demo and i will look again. Tried both V3 and V2 of charts demos. For both mobile and OS X.

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 11, 2016

When you highlight, it will highlight the closest data entry, not where user touches.
But you can easily override the highlight methods and some other functions (started with tapGestureRecognized) to work this way.

@moon47usaco
Copy link
Author

Thats what I was afraid of, sounds like fun... =]

It will have to wait until I have more time to study the highlight method.

Thank you.

@vojto
Copy link

vojto commented Oct 12, 2016

@moon47usaco The example you linked also only highlights if there's a data point, at least for horizontal axis. Notice if you move your cursor from left to right, it snaps to the next day.

But I don't want to highlight points where there are no data - so eg. if I have daily stock values, I don't want to show tooltip in between two dates, because I don't know what is the value of stock at that point.

Anyway, I'm going to modify this library to get something like that example you linked. I just need to highlight whenever user moves their mouse.

Happy to share code or work together, hit me up on Twitter - @_vojto

@moon47usaco
Copy link
Author

I would be happy to work on this with you but I need to get real time charting working first as it is a higher priority for me right now. See : #1649.

Once I am able to update the current bar before a new one is added this is next on my list.

And yes it should snap to x-values as it does now but be able to move freely in the y-value so that you only get highlight for points where there is data but the y-value shown on the highlight ca be arbitrary and not connected to a data point.

I would also like it to visually show a marker on the right hand side of the chart for the y-value that was clicked/tapped but that is extra topping on the cake so to speak... =]

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