10 Answers, 1 is accepted
Thank you for using our controls.
TKChart inherits from UIView, so you can use its userInteractionEnabled property to ignore or process user interactions to the chart. You should set this property to NO, and the touch event will be handled by the scroll view. Please consider the code snippet below:
chart
.userInteractionEnabled
=
NO
;
I hope this helps. Do not hesitate to contact us if you need further assistance.
Regards,
Adrian
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Currently it is not possible to disable specific user interactions in TKChart. We plan to add this functionality in one of our future versions. The issue is logged in our feedback portal and you can use the following link to track the issues status..
You can work around the issue by using a tap gesture recognizer. You still should set the userInteractionEnabled property to NO, so that the scroll view can handle touch events. Then you should add UITapGestureRecognizer to TKChart's parent view which will handle the tap for the selection. Consider the code snippet below:
- (
void
)viewDidLoad
{
//...
[scrollView
addSubview
:_chart];
//...
UITapGestureRecognizer
*tapRecognizer = [[
UITapGestureRecognizer
alloc]
initWithTarget
:
self
action
:
@selector
(tap:)];
[scrollView
addGestureRecognizer
:tapRecognizer];
}
- (
void
)tap:(
UITapGestureRecognizer
*)gestureRecognizer
{
CGPoint touchPoint = [gestureRecognizer
locationInView
:_chart
.plotView
];
TKChartSelectionInfo
*hitTestInfo = [_chart
hitTestForPoint
:touchPoint];
[_chart
select
:hitTestInfo];
}
You should also allow selection by setting the series selectionMode property to the desired value:
series
.selectionMode
= TKChartSeriesSelectionModeSeries;
If you need further assistance I will be glad to help.
Regards,
Adrian
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
series.selectionMode = TKChartSeriesSelectionModeDataPoint;
I am glad to hear that I could be of help.
I will be happy to assist you if you have further questions.
Regards,
Adrian
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hello Adrian,
I have been following the issue status using the link you provided. It says that the functionality was completed in October of 2015, but I can't seem to find the documentation for it. Can you point me in the right direction?
To clarify exactly what I am looking to accomplish with this functionality:
Issue: I have a TKChart inside of a UITableViewCell (and therefore, a UIScrollView as the parent of the UITableView that contains the cell). When I scroll the UITableView, everything works fine unless I a touch within the TKChart, in which case I cannot scroll the UITableView as usual.
Solution: Ideally, I can disable specific user interactions that are disallowing the touch to pass through to the UITableView's scrollView, and thereby scroll as usual.
Thanks for your help.
Zach
Please find my response in the other support thread.
Regards,
Adrian
Telerik
Hello Adrian,
Can you post the link to your other support thread.
And on that note -- I've noticed that the links I included in my note have been stripped out of the post. How do you suggest I share these with you going forward?
Thank you,
Zach
Ah, I just saw the ticket response. I will review and get back to you. Thank you Adrian.
Zach