7 Answers, 1 is accepted
0
Hello Itamar,
The easiest way to achieve this is using a TKChartViewAnnotation. You can draw your icon to a view and attach a tap recognizer to it and then create a view annotation with the icon view. Here is a sample code snippet:
I hope this helps.
Regards,
Adrian
Telerik by Progress
The easiest way to achieve this is using a TKChartViewAnnotation. You can draw your icon to a view and attach a tap recognizer to it and then create a view annotation with the icon view. Here is a sample code snippet:
public
override
void
ViewDidLoad ()
{
base
.ViewDidLoad ();
//...
UIView icon =
new
UIView(
new
CGRect(0, 0, 50, 50));
icon.BackgroundColor = UIColor.Red;
UITapGestureRecognizer tapRecognizer =
new
UITapGestureRecognizer(
this
,
new
ObjCRuntime.Selector(
"DidTapIcon"
));
icon.AddGestureRecognizer(tapRecognizer);
chart.AddAnnotation (
new
TKChartViewAnnotation(icon,
new
NSNumber(550),
new
NSNumber(90), chart.Series[0]));
}
[Export (
"DidTapIcon"
)]
public
void
DidTapIcon()
{
Console.WriteLine(
"Tapped"
);
}
I hope this helps.
Regards,
Adrian
Telerik by Progress
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

Itamar
Top achievements
Rank 1
answered on 29 Dec 2016, 12:11 PM
Thanks for the answer
I need this for xamarin android
We work with CartesianCustomAnnotation , ContentRenderer
Thanks
0
Hi Itamar,
Thank you for writing.
I confirm that this is a bug on our side and we are aware of it.
For now the workaround is to set the old zoom and pan after your annotation is added.
Regards,
Victor
Telerik by Progress
Thank you for writing.
I confirm that this is a bug on our side and we are aware of it.
For now the workaround is to set the old zoom and pan after your annotation is added.
Regards,
Victor
Telerik by Progress
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

Itamar
Top achievements
Rank 1
answered on 08 Mar 2017, 09:29 PM
How can I get the coordinates (x int, y date) when the user clicks on the charts?
0
Hi,
This might help:
http://stackoverflow.com/questions/1967039/onclicklistener-x-y-location-of-event
Although its written in Java, the C# code will not be much different.
Regards,
Deyan
Telerik by Progress
This might help:
http://stackoverflow.com/questions/1967039/onclicklistener-x-y-location-of-event
Although its written in Java, the C# code will not be much different.
Regards,
Deyan
Telerik by Progress
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

Itamar
Top achievements
Rank 1
answered on 16 Mar 2017, 09:59 AM
I already tried that and it didn’t work
I try with OnTouchListener
And OnTouchClickListener
Nothing works
Can you send me working code example
I try with OnTouchListener
And OnTouchClickListener
Nothing works
Can you send me working code example
0
Hello Itamar,
Thanks for writing back.
Can you please send me the full source you are using to reproduce the behavior as I am not able to on my side? Setting a touch listener on my chart allows me to receive touch events and handle them (this should be working with Xamarin.Android in pretty much the same way.):
Do you have any behaviors that consume touch events on the chart enabled - like PanAndZoom for example?
Thanks.
Regards,
Deyan
Telerik by Progress
Thanks for writing back.
Can you please send me the full source you are using to reproduce the behavior as I am not able to on my side? Setting a touch listener on my chart allows me to receive touch events and handle them (this should be working with Xamarin.Android in pretty much the same way.):
cartesianChart.setOnTouchListener(
new
View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if
(v !=
null
){
if
(event.getAction() == MotionEvent.ACTION_UP) {
float xCoord = event.getX();
float yCoord = event.getY();
}
}
return
false
;
}
});
Do you have any behaviors that consume touch events on the chart enabled - like PanAndZoom for example?
Thanks.
Regards,
Deyan
Telerik by Progress
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