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

Highlight any entry #4333

Closed
1 task done
ProyectoNeuron opened this issue Apr 6, 2020 · 1 comment
Closed
1 task done

Highlight any entry #4333

ProyectoNeuron opened this issue Apr 6, 2020 · 1 comment

Comments

@ProyectoNeuron
Copy link

ProyectoNeuron commented Apr 6, 2020

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

Per our *CONTRIBUTING guidelines, we use GitHub for
bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag ios-charts.

Please remove this line and everything above it before submitting.

What did you do?

ℹ Please replace this with what you did.

I have created a method for selecting the current date where the x-axis values are dates.

It works correctly if the entry to highlight has a value inside the dataset.

If this entry does not exist, the closest value is highlighted (apparently) even though the x-axis is selected correctly. The highlighted no.

https://ibb.co/hLMRBrY

ℹ Please replace this with what you expected to happen.

expected the highlight line to match the selected x-axis value

ℹ Please replace this with of what happened instead.

Charts Environment

Charts version/Branch/Commit Number: 3.2.0
Xcode version: 11.3.1
Swift version: 4.2
Platform(s) running Charts: iOS app
macOS version running Xcode:

Demo Project

I'm testing this
@objc private func selectedCurrent() { if let dataSets = graphicsView.data?.dataSets as? [LineChartDataSet] { let entry = ChartDataEntry(x: Double(currentDate - 1), y: 0.0) let currentSelection = graphicsView.getPosition(entry: entry, axis: YAxis.AxisDependency.left) let highlight = Highlight(x: Double(currentSelection.x), y: Double(currentSelection.y), xPx: currentSelection.x, yPx: currentSelection.y, dataSetIndex: currentDate, stackIndex: currentDate, axis: YAxis.AxisDependency.left) graphicsView.highlightValue(graphicsView.getHighlightByTouchPoint(currentSelection)) self.chartValueSelected(graphicsView, entry: entry, highlight: highlight) } }

@pmairoldi
Copy link
Collaborator

Closed by #4721

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

2 participants