I am handling a Series click event and if I touch up outside and let go on a series, I get a fatal error (not in me code).
Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
at Steema.TeeChart.Chart.DoMouseDown (Boolean IsDoubleClick, MonoTouch.UIKit.UIGestureRecognizer e) [0x00000] in <filename unknown>:0
at Steema.TeeChart.TChart.OnMouseMove (MonoTouch.UIKit.UIGestureRecognizer e) [0x00000] in <filename unknown>:0
at Steema.TeeChart.TChart.PanGesture (MonoTouch.UIKit.UIPanGestureRecognizer e) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at eLogic.Application.Main (System.String[] args) [0x00000] in /Users/ndiab/Projects/eLogic/eLogic/Main.cs:17
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Cannot cast from source type to destination type.
at Steema.TeeChart.Chart.DoMouseDown (Boolean IsDoubleClick, MonoTouch.UIKit.UIGestureRecognizer e) [0x00000] in <filename unknown>:0
at Steema.TeeChart.TChart.OnMouseMove (MonoTouch.UIKit.UIGestureRecognizer e) [0x00000] in <filename unknown>:0
at Steema.TeeChart.TChart.PanGesture (MonoTouch.UIKit.UIPanGestureRecognizer e) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at eLogic.Application.Main (System.String[] args) [0x00000] in /Users/ndiab/Projects/eLogic/eLogic/Main.cs:17
Unhandled exception in iOS charting
Re: Unhandled exception in iOS charting
Hello,
I've been doing some tests here, and using the following code it is wording fine :
You can try to add this code to the Features demo project.
Does the problem happens with both simulator and device ?
In the case you still having problems, would you be so kind to send us a simple test project with which we can reproduce the problem as is here ?
I've been doing some tests here, and using the following code it is wording fine :
Code: Select all
_controller.chart.ClickSeries += new Steema.TeeChart.TChart.SeriesEventHandler(series_clicked);
private void series_clicked(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, UIGestureRecognizer e)
{
Console.WriteLine("Series clicked");
}
Does the problem happens with both simulator and device ?
In the case you still having problems, would you be so kind to send us a simple test project with which we can reproduce the problem as is here ?
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Unhandled exception in iOS charting
Pep,
Thanks for the response. I work with the originator of this article and we're both trying to determine the reason for this crash.
Your code example addresses tapping on a series. We have that working fine and can zoom into the series as we want. I did try implementing your code (successfully) but the crash still exists when you pan the chart. The problem is when we try to pan the chart by starting from a point where you tap on a series (bar, line, etc) and then swipe left or right and let go. This causes a crash. Please try try creating a bar chart, for example, and then pan it left or right. If you pan by touching above all the series, you're fine. If you pan by touching a series first, it crashes.
This is rather time sensitive and we purchased your product specifically for this project. Unfortunately, we are now thinking we may have to abandon your product because this is a serious issue and a show stopper. A quick turn around would be greatly appreciated.
Thanks very much!
Bob
Thanks for the response. I work with the originator of this article and we're both trying to determine the reason for this crash.
Your code example addresses tapping on a series. We have that working fine and can zoom into the series as we want. I did try implementing your code (successfully) but the crash still exists when you pan the chart. The problem is when we try to pan the chart by starting from a point where you tap on a series (bar, line, etc) and then swipe left or right and let go. This causes a crash. Please try try creating a bar chart, for example, and then pan it left or right. If you pan by touching above all the series, you're fine. If you pan by touching a series first, it crashes.
This is rather time sensitive and we purchased your product specifically for this project. Unfortunately, we are now thinking we may have to abandon your product because this is a serious issue and a show stopper. A quick turn around would be greatly appreciated.
Thanks very much!
Bob
Re: Unhandled exception in iOS charting
Hi Bob,
yes, you're correct, I'm able to reproduce the problem here.
I'm trying to fix it. I can advise and send the new assembly to you when it's fixed. Hope as soon as possible.
yes, you're correct, I'm able to reproduce the problem here.
I'm trying to fix it. I can advise and send the new assembly to you when it's fixed. Hope as soon as possible.
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Unhandled exception in iOS charting
Hi Bob,
I've just sent the fixed dll to the mail account you have registered in this forum.
Don't hesitate to let us know if you still find any problem with it.
I've just sent the fixed dll to the mail account you have registered in this forum.
Don't hesitate to let us know if you still find any problem with it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Unhandled exception in iOS charting
Yeray,
Thanks so much. I installed the new DLL and it's working. You rock! Thanks for the great support Steema!
Bob
Thanks so much. I installed the new DLL and it's working. You rock! Thanks for the great support Steema!
Bob
Re: Unhandled exception in iOS charting
Ok guys, the crash problem is corrected, but now I have something else going on related to this.
Now if I do a swipe to scroll the bar graph, the click/tap is registered right away. We have a click handler that "Zooms" in to the next level of data when you pick a series. This needs to only happen when the user taps and does not swipe. And likewise, when we swipe, we need it to move and not do the click event. Here's our click series handler. Any suggestions would be great.
Thanks,
Bob
void Handle_chartClickSeries (object sender, Steema.TeeChart.Styles.Series s, int valueIndex, UIGestureRecognizer e)
{
if (e.State == UIGestureRecognizerState.Cancelled ||
e.State == UIGestureRecognizerState.Failed ||
e.State == UIGestureRecognizerState.Possible)
return ;
if (valueIndex > s.XValues.Count)
return;
switch (_resolution)
{
case "Monthly":
_resolution = "Daily";
break;
case "Daily":
_resolution = "Hourly";
break;
case "Hourly":
default:
return;
}
_startDate = Steema.TeeChart.Utils.DateTime(s.XValues[valueIndex]);
DisplayPortraitData();
DisplayChartData();
}
Now if I do a swipe to scroll the bar graph, the click/tap is registered right away. We have a click handler that "Zooms" in to the next level of data when you pick a series. This needs to only happen when the user taps and does not swipe. And likewise, when we swipe, we need it to move and not do the click event. Here's our click series handler. Any suggestions would be great.
Thanks,
Bob
void Handle_chartClickSeries (object sender, Steema.TeeChart.Styles.Series s, int valueIndex, UIGestureRecognizer e)
{
if (e.State == UIGestureRecognizerState.Cancelled ||
e.State == UIGestureRecognizerState.Failed ||
e.State == UIGestureRecognizerState.Possible)
return ;
if (valueIndex > s.XValues.Count)
return;
switch (_resolution)
{
case "Monthly":
_resolution = "Daily";
break;
case "Daily":
_resolution = "Hourly";
break;
case "Hourly":
default:
return;
}
_startDate = Steema.TeeChart.Utils.DateTime(s.XValues[valueIndex]);
DisplayPortraitData();
DisplayChartData();
}
Re: Unhandled exception in iOS charting
Hi Bob,
I think one woy could be checking what kind of UIGestureRecognizer is into the Handle_chartClickSeries method. You should be able to do something like:
I think one woy could be checking what kind of UIGestureRecognizer is into the Handle_chartClickSeries method. You should be able to do something like:
Code: Select all
if (e is UISwipeGestureRecognizer)
{}
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Unhandled exception in iOS charting
Thank you Josep! We got it working.
Bob
Bob