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

Interact with legend and display the selected data in line chart #1306

Open
Huang-Libo opened this issue Aug 10, 2016 · 12 comments
Open

Interact with legend and display the selected data in line chart #1306

Huang-Libo opened this issue Aug 10, 2016 · 12 comments
Labels

Comments

@Huang-Libo
Copy link

Huang-Libo commented Aug 10, 2016

Can Charts do the job below ?

#1. Just like the picture below, by default three legends are selected and displayed on line chart, then user can tap at legend to highlight some legends and append new data at line chart.
#2. If user tap at line chart to select a day (x value), it will display today's (x value's) associated title and value in the center of line chart.

img_2920
img_2921
img_2922

@danielgindi
Copy link
Collaborator

Displaying that black box in the middle - is possible by implementing a custom Marker. (In v3 this also becomes much more easier).

Interactive legends are not yet supported - but are a nice feature request.

@Huang-Libo
Copy link
Author

@danielgindi
If I can get each legend's container(UILabel?) , then I can add gesture to interact with legend.

@danielgindi
Copy link
Collaborator

It's not a label - it's dynamically rendered. But the sizes are available internally. There's a function that calculates the expected layout, and then the renderer uses it to render.
Since it is now implemented this way for a few months already - it makes it much easier to make the legend interactive.

We've thought about using layers - but it over complicates stuff, as we might change the rendering engine from CoreGraphics to something else in the future. I'm considering SK or a subset of it.

@Huang-Libo
Copy link
Author

I see. By the way, what is SK?

@liuxuan30
Copy link
Member

liuxuan30 commented Aug 12, 2016

@danielgindi I used to use a scroll view to hold the legend, clickable and has synergy with the highlight. I think current legend still has the space issue.

@farshidce
Copy link

i also highly need this feature for what i am working on. I looked at the code and as @danielgindi mentioned the legends are not distinct UILabels which you can attach recognizers.
I don't mind spending time on adding this feature if this is not picked up by anyone else.

just thinking out loud here , is it possible to actually find out where user clicked using "(ChartViewBase *__nonnull)chartView" ?

@reallyseth
Copy link

I'm also interested in helping add this feature. @farshidce have you made any progress on this?

@monkeyRing
Copy link

+1

@xuyecan
Copy link

xuyecan commented Feb 20, 2017

+1

1 similar comment
@manishpathak99
Copy link

+1

@manishpathak99
Copy link

manishpathak99 commented Jun 6, 2017

I want to add similar feature . Any progress ?

@jlubeck
Copy link

jlubeck commented Aug 29, 2019

Is there any progress on this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants