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

Overriding Highlight #960

Closed
arjunnayak opened this issue Apr 20, 2016 · 9 comments
Closed

Overriding Highlight #960

arjunnayak opened this issue Apr 20, 2016 · 9 comments

Comments

@arjunnayak
Copy link

Is it possible to override a LineChartView's highlight to draw and call the delegate's 'chartValueSelected' method even if there is no data at that specific xIndex? I've attempted to make changes in the actual highlight code logic but it feels way too hacky.

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 20, 2016

well if there is really no data (NOT data that value = zero), from the definition:

chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight)

no arguments are allowed optional, how do you deal with it?
I don't think there is a way not hacky :)

@danielgindi
Copy link
Collaborator

You can always supply your own Highlighter object.
The Highlighter object is a pretty new thing in Charts, and we'll be modifying the interfaces a bit soon. So head up!

@liuxuan30
Copy link
Member

@danielgindi oh man what changes? I just sync my library to 2.2.4.

@danielgindi
Copy link
Collaborator

interface-wise- nothing big. Currently the types are wrong (Float/Double), and one of the function has an additional parameter to accept a data index for better supporting combined chart

@liuxuan30
Copy link
Member

liuxuan30 commented May 3, 2016

speaking of combined chart - we might be careful because a data(set?) index seems not additonal to me, considering the grouped bars support. These are the pain points when I have to think about markers and highlight for combined chart individual shape and dot.

@danielgindi
Copy link
Collaborator

Well at first stage I want to allow highlighting individual values, bars, shapes etc.

Then after that- to add a property "highlightFullBars" to bar/line based charts- that will allow to select anywhere on the bar to select the whole thing. In combined chart it will allow the current behavior of selecting the full bar with all its values.

The first stage is actually read, there's a PR on the Android side waiting for review @PhilJay.

@liuxuan30
Copy link
Member

liuxuan30 commented May 3, 2016

OK. But I do think we should get started thinking of grouped bar support in combined chart. Sometimes it just gets more complicated or inconvenient when we refactor the code without thinking grouped bar support. And my PR is about 1 year old baby soon, lol

@danielgindi
Copy link
Collaborator

Yeah I know :-)
Problem is Phil is working on making x indices more flexible. Using Doubles instead of Integers, and allowing for x-axis with steps that are now "whole".
Well this is not a problem, it's a major feature that's the first one going into v3, but we cannot do any work on Group bars in Combined chart before that's completed :-)

@liuxuan30
Copy link
Member

alright, let's see!

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