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

Getting x,y values of points in LineChart #739

Closed
leonidster opened this issue Feb 5, 2016 · 5 comments
Closed

Getting x,y values of points in LineChart #739

leonidster opened this issue Feb 5, 2016 · 5 comments

Comments

@leonidster
Copy link

Hi,

First of all, thank you for your great great project.

I'm using a LineChart and looking for an easy way to get the x/y of the last point,

in order to draw a customizable static bubble above/underneath it (not on Highlighting).

What is the easiest way to get these values?

Thanks :)

@liuxuan30
Copy link
Member

I guess you have to first get the last point x, y and use delegate or you add a new method to draw the custom shape you want in drawExtras

@leonidster
Copy link
Author

@liuxuan30 Thanks for reply. My question is how to get these values. I have the LineChart object, what is the method to get the last point x,y? I'd appreciate an example very much.

@liuxuan30
Copy link
Member

I don't think currently there is method to return the pixel x,y to you. You have to change the code to get it, by delegate, that's the easiest one. Or you can walk through the code to calculate it directly.

@danielgindi
Copy link
Collaborator

Actually you can use the transformer for this. You give it a point on the chart which represents an xIndex and a yValue, and in return you get a pixel based x/y

@liuxuan30
Copy link
Member

Yep but the left/right transformer is internal - so in some cases we cannot use it directly.
Consider a API to provide pixel x,y?

I used to write a delegate to get the x, y.
@leonidster if you were able to touch the source code, using chart transfomer + delegate or API is the easy way to do it I think.

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

3 participants