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

Select the data point programmatically and the highLight is NAN #3363

Closed
HsiaoAi opened this issue Mar 26, 2018 · 1 comment
Closed

Select the data point programmatically and the highLight is NAN #3363

HsiaoAi opened this issue Mar 26, 2018 · 1 comment

Comments

@HsiaoAi
Copy link

HsiaoAi commented Mar 26, 2018

I'd like to select the last data point programmatically and draw gradient background, but i get the highLight is NAN so I cant get the coordinate to draw the gradient.
I used :
chartView.highlightValue(Highlight(x: lastEntry.x, y: lastEntry.y, dataSetIndex: 0), callDelegate: true)
to select the last entry, and draw the gradient in the delegate function:
func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) but the highlight is NAN.
I also tried using "valueToPixelMatrix" way to get the coordinate, but the results are different from the highlight.xPx and highlight.yPx,
i would like to ask how can i get the correct coordinate of data point on Chart View,
Thank you guys.

@jjatie
Copy link
Collaborator

jjatie commented Apr 15, 2018

Please note that for how-to's, ask on Stack Overflow. If you would like to file an issue or feature request, please fill out the form provided.

@jjatie jjatie closed this as completed Apr 15, 2018
@ChartsOrg ChartsOrg locked as off-topic and limited conversation to collaborators Apr 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants