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

Implementing Gestures #519

Closed
htran91 opened this issue Oct 29, 2015 · 4 comments
Closed

Implementing Gestures #519

htran91 opened this issue Oct 29, 2015 · 4 comments

Comments

@htran91
Copy link

htran91 commented Oct 29, 2015

I'm having trouble implementing gestures to interact with my line chart. I am pretty new to swift programming but i know that you can highlight values using the chartValueSelected function. It appears as the mpandroidcharts has something that allows for gesture recognition when highlighting lines. Is there something in this port that does the same thing?

@liuxuan30
Copy link
Member

gestures should be different on these platforms. It already has tap gesture and other gestures (pinch, pan) there. You can write your own gesture handler.

@danielgindi
Copy link
Collaborator

You should read about UIGestureRecognizers in iOS. It's a wonderful gesture
system.

@ashish1703
Copy link

Hi,

Well i am trying to add a tap gesture to the barchartView but not getting succeeded.
This the code which i am using:

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touch:)];
[tap setNumberOfTapsRequired:1]; // Set your own number here
[tap setDelegate:self]; // Add the protocol

UILongPressGestureRecognizer *longTap = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longTouch:)];
[longTap setNumberOfTapsRequired:0]; // Set your own number here
[longTap setMinimumPressDuration:1.0];
[longTap setDelegate:self]; // Add the <UIGestureRecognizerDelegate> protocol
[tap requireGestureRecognizerToFail:longTap];   // Priority long

[self.barchartV addGestureRecognizer:tap];
[self.barchartV addGestureRecognizer:longTap];

Nothing gets to the selector functions.

Please help..!!

@liuxuan30
Copy link
Member

file a new issue if it's releated to the charts, or ask it on StackOverflow for technical quetions.
To me, seems bar chart already has tap gesture so some conflicts maybe. Ask on SO is much easier to get it answered.

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

4 participants