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

Can't select segments of PieChart shown in UITableViewCell #46

Open
siburb opened this issue Mar 5, 2014 · 3 comments
Open

Can't select segments of PieChart shown in UITableViewCell #46

siburb opened this issue Mar 5, 2014 · 3 comments

Comments

@siburb
Copy link

siburb commented Mar 5, 2014

I'm initialising an XYPieChart inside "cellForRowAtIndexPath", and I have a property for the Pie Chart in the viewController that contains the UITableView (and is also its DataSource and Delegate).

The viewController is the Pie Chart's delegate, and is adhering to its protocol correctly - the chart itself is displaying perfectly. The chart, table cell, table and containing view all have user interaction enabled.

However, neither the didSelect, or willSelectSliceAtIndex methods are ever performed. Has anyone had any similar experience of this?

@ghost
Copy link

ghost commented Mar 6, 2014

I have the same issue with the chart, which is embedded in container view in a static table view cell. I don't have any solution to this problem yet.

@myusuf3
Copy link

myusuf3 commented Apr 18, 2014

I have it in a simple view can I can't seem to trigger delegate methods. Whats seems to be the problem?

@munibsiddiqui
Copy link

I have encountered the same problem , then i dig XYPieChart class . Actually When using in UITableView Or UIScrollView the touch events for XYPieChart has been canceled by their touch events . So basically we have to pass touch event to our XYPieChart instant .

I created a custom cell in which i pass the touch event like this :
Now its working fine :)
-(void)touchesEnded:(NSSet )touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
if (CGRectContainsPoint([self.backgroundView frame], [touch locationInView:self])){
/
Added this to resolve the issue
* [super touchesCancelled:touches withEvent:nil];
/
}
else if (CGRectContainsPoint([self.contentView frame], [touch locationInView:self])) {
[self.pieChartView touchesEnded:touches withEvent:event];
}
else{
/
Added this to resolve the issue
* [super touchesCancelled:touches withEvent:nil];
*/
}

}

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