This is a migrated thread and some comments may be shown as answers.

How to add TKChartDelegate on UITableViewCell

2 Answers 21 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Koldo
Top achievements
Rank 1
Koldo asked on 11 Apr 2016, 11:31 AM

Hi,

In my telerik app, the charts are showed in a tableview (the TKChart is on a custom UItableViewCell class), and I need to access to data point event with TKChartDelegate.

My problem is to access TKChartDelegate methods, because I can not put these methods on my custom UITableViewCell class.

 

Any solution please?

Regards.

2 Answers, 1 is accepted

Sort by
0
Accepted
Sophi
Telerik team
answered on 14 Apr 2016, 07:20 AM
Hi Koldo,

From what I understand each cell of your ListView contains a TKChart. You can conform to the TKChartDelegate protocol in your custom cell class and then set the cell as a delegate to the chart.
Consider the following snippet.
@interface CustomListCell : UITableViewCell<TKChartDelegate>
 
@end
 
-----------------
 
@implementation CustomListCell
 
-(instancetype)initWithFrame:(CGRect)frame
{
   TKChart *chart = [[TKChart alloc] init];
   chart.delegate = self;
   self.addSubview(chart);
}
 
 ...implement delegate methods
@end
In case this does not work out, do not hesitate to write back.

Regards,
Sophi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Koldo
Top achievements
Rank 1
answered on 14 Apr 2016, 07:28 AM

Yes!!

 

Thank you :)

Tags
Chart
Asked by
Koldo
Top achievements
Rank 1
Answers by
Sophi
Telerik team
Koldo
Top achievements
Rank 1
Share this question
or