Hi All,
Platform: Xamarin/iOS
I want my app to display a detailed information about each data point every time the user clicks on the point.
For this :
- I am setting <TChar>.ClickSeries to call my event handler every time the user clicks on the data point of the serie.
- I also setting <Serie>.ClickableLine to true to increase the 'tappable area'.
It works most of the time (70%) but in other times the user has to click may times before TeeChart calls my ClickSeries event handler.
Is this a bug ? otherwise how can I make sure that my event handler is always called.
Thanks
--maX
Clicking on series does not always trigger the event handler
Re: Clicking on series does not always trigger the event handler
Hi All,
My solution to this problem:
Since clicking on the serie data points was not reliable in my experience (it worked 70%). I did re-implement all the code using the TChart.ClickBackground event handler where I had more control. I am not using TChart.ClickSeries any more.
theChart.ClickBackground += (recognizer, touch) =>
{
CGPoint p = recognizer.LocationInView(<your view>);
... business logic based on the position of point p in <your view>
return true;
};
Thanks
--maX
My solution to this problem:
Since clicking on the serie data points was not reliable in my experience (it worked 70%). I did re-implement all the code using the TChart.ClickBackground event handler where I had more control. I am not using TChart.ClickSeries any more.
theChart.ClickBackground += (recognizer, touch) =>
{
CGPoint p = recognizer.LocationInView(<your view>);
... business logic based on the position of point p in <your view>
return true;
};
Thanks
--maX
Re: Clicking on series does not always trigger the event handler
Hello maX,
I'm glad to hear you've found a good solution to the problem.
Just let you know that we've been working on this area (improving the gesture event handlers) and also added a new ClickTolerance series property in order to help in these cases.
Changes will be included into the next maintenance release which will be published on our website during this month.
I'm glad to hear you've found a good solution to the problem.
Just let you know that we've been working on this area (improving the gesture event handlers) and also added a new ClickTolerance series property in order to help in these cases.
Changes will be included into the next maintenance release which will be published on our website during this month.
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Clicking on series does not always trigger the event handler
Thanks Jorge,
Unfortunately it fixed one problem (detect where the Tap gesture recogniser is in relation to the graph) but broke the horizontal scrolling in the chart.
Below is my pseudo code. Where I want to do different actions depending if the gesture recogniser is tap or pane.
What is the meaning of ClickBackground return boolean?
Is there anything I can do to pass the touch ? (e.g recognizer.CancelsTouchesInView = false)
I tried all combinations of ClickBackground return true/false but none worked.
Even an empty ClickBackground broke the scrolling (I guess because it eats the pane begin touch event?)
Unfortunately we need to release next week
Unfortunately it fixed one problem (detect where the Tap gesture recogniser is in relation to the graph) but broke the horizontal scrolling in the chart.
Below is my pseudo code. Where I want to do different actions depending if the gesture recogniser is tap or pane.
Code: Select all
bool theChart_ClickBackground(UIGestureRecognizer recognizer, UITouch touch)
{
var tap = recognizer as UITapGestureRecognizer;
if (tap != null)
{
.. handle tap
return true;
}
var pane = recognizer as UIPanGestureRecognizer;
if (pane != null)
{
... handle scrolling
return true;
}
return false;
}
Is there anything I can do to pass the touch ? (e.g recognizer.CancelsTouchesInView = false)
I tried all combinations of ClickBackground return true/false but none worked.
Even an empty ClickBackground broke the scrolling (I guess because it eats the pane begin touch event?)
Unfortunately we need to release next week
Re: Clicking on series does not always trigger the event handler
Hello maX,
ok, I'm going to prepare an example that allows to show detail of data when the user taps over the series point and also that allows to scroll horizontally. I'll send asap.
ok, I'm going to prepare an example that allows to show detail of data when the user taps over the series point and also that allows to scroll horizontally. I'll send asap.
The event is defined as UITouchEventArgs which comes from the following Xamarin class :What is the meaning of ClickBackground return boolean?
Code: Select all
namespace UIKit
{
//
// Summary:
// A delegate used in conjunction with the UIKit.UIGestureRecognizer.ShouldReceiveTouch
// property.
//
// Parameters:
// recognizer:
// The recognizer that triggered this touch event.
//
// touch:
// The actual touch event recognized.
public delegate bool UITouchEventArgs(UIGestureRecognizer recognizer, UITouch touch);
}
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Clicking on series does not always trigger the event handler
Hello maX,
just let you know that I've sent a mail directly to you with the example I mentioned above and a beta version of the next TeeChart for Xamarin.iOS maintenance release.
just let you know that I've sent a mail directly to you with the example I mentioned above and a beta version of the next TeeChart for Xamarin.iOS maintenance release.
Pep Jorge
http://support.steema.com
http://support.steema.com