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

Adjust circle for selected point #1597

Closed
nicholassmith opened this issue Oct 2, 2016 · 7 comments
Closed

Adjust circle for selected point #1597

nicholassmith opened this issue Oct 2, 2016 · 7 comments

Comments

@nicholassmith
Copy link

Is it possible to adjust the displayed circle for a point on a line chart? I've looked at the public API in the headers and can't see an obvious way. Do I need to use a marker view to achieve it?

@apurva
Copy link

apurva commented Oct 6, 2016

I am looking for the same solution, as it could solve the highlighting issue being discussed here: #1495

Does anyone know how to get the screen co-ordinates of a selected point on a line graph?

@nicholassmith
Copy link
Author

It seemed like it wasn't doable, I ended up using a secondary data set to show the highlighted value with a different circle.

@liuxuan30
Copy link
Member

Check out LineChartRenderer's drawCircles() and drawHighlighted. Looks like you have to override it for now, as not many people asking this.

@apurva
Copy link

apurva commented Oct 10, 2016

Thanks for the tip! I am guessing the secondary dataset would have only one value (the one that would be highlighted). Could you tell me how you are able to set the x position of the dataset to align with the x position of the selected item in the main graph?

@liuxuan30
Copy link
Member

not very clear your question

@nicholassmith
Copy link
Author

@apurva there's a delegate which is triggered when a value is selected (I'm not at my development machine so I'll post later what it is exactly). That returns a ChartDataEntry which contains the Y & X values, you create a ChartDataSet with that entry and it'll draw over the other entry.

@apurva
Copy link

apurva commented Oct 17, 2016

@nicholassmith Thanks again! That worked for me and I am able to show a filled circle for the highlighted point.

For others reading this, the delegate methods to do this in are - chartValueSelected: & chartValueNothingSelected:

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