System.ArgumentNullException Value cannot be null. Parameter name: type

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Jan 11, 2021 6:18 pm

With Xamarin.Forms Version 5.0.0.1874, Version 4.8.0.1821, Version 4.8.0.1687 and Version 4.8.0.1560, graphs break on both Android and iOS. it displays if you catch the exceptions but does not render correctly: popup annotations are broken and don't show, pinch and zoom is gone, etc.

I have not tested versions prior to Version 4.8.0.1560.

Previous Related Issue
Attachments
chartviewer.PNG
chartviewer.PNG (70.52 KiB) Viewed 1597 times
chart.PNG
chart.PNG (59.04 KiB) Viewed 1597 times

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Tue Jan 12, 2021 5:14 pm

Hello,

it seems that is working fine here. Do you have a simple example to reproduce it ?
Anyway, just tell to you, that we're going to upload a new nuget version package before the end of this week (compiled with the latest Xamarin.Forms version).

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Jan 25, 2021 5:13 pm

just updated nugets and both exceptions still occur.

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Jan 25, 2021 5:24 pm

Steema.TeeChart.Tools.NearestPoint.Point doesn't seem to be updating when the NearestPoint.Change event occurs.



Also, it would be very helpful if the new point/index can be passed via the event args in the EventHandler, such as:

Code: Select all

	public class NearestPointEventArgs : EventArgs
	{
		public int Point { get; set; }

		public NearestPointEventArgs() { }
		public NearestPointEventArgs( int point )
		{
			Point = point;
		}
	}
Then the updated NearestPoint class would be:

Code: Select all

	public class NearestPoint : ToolSeries
	{
		...
		public event EventHandler<NearestPointEventArgs> Change;
		...
	}

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Mon Jan 25, 2021 6:12 pm

Hello,
just updated nugets and both exceptions still occur.
We did some tests with the latest Xamarin.Forms version available and it seems that comes with a problem that might be related to the one that you writen here, so we decided to wait for the next Xamarin.Forms stable version in order to compile against this one.

About the nearest point question.
Have you looked at the following nearest point tool example ?

https://github.com/Steema/teechart-xama ... tPointTool

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Jan 25, 2021 9:20 pm

yes, I checked out the nearest point tool example. I stepped through with visual studio's debugger; it's not being updated.

They just released Xamarin.Forms v5.0.0.1931, the issue still occurs

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Wed Jan 27, 2021 7:19 pm

Hello,

yes, you're correct. I'm able to reproduce the problem here by using the latest TeeChart for Xamarin.Forms version published.
The problem appeared since the 4.2020.9.28 version.
In order to make it work until we fix the problem ,you'd have to use the 4.2020.5.28 version.

I've already added this as an important bug here : bug 2400
We'll try to fix it as sson as possible and upload a new nuget version.

We'll also consider your apportation to add this as a new functionality for the NearestPontTool. Thank you.

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Wed Jan 27, 2021 9:26 pm

Thank you for you time.

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Thu Jan 28, 2021 4:08 pm

Using 4.2020.5.28, the NearestPoint tool is working again. but the exceptions still occur from above.

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Thu Feb 04, 2021 11:32 am

Yes, the exception seems to be related with Xamarin.Forms v5. Not sure if it also happens to you with older Xamarin.Forms version.

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Fri Feb 19, 2021 3:23 pm

Hello,
just inform to you that a new TeeChart for Xamarin.Forms Nuget version has been published, this one compiled with the latest Xamarin.Forms stable version and also includes fixes for NearestPointTool change event and also the feature you commented.

Nuget version

Thanks.

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Feb 22, 2021 9:35 pm

I now get a System.InvalidCastException: 'Specified cast is not valid.' error when I touch the graph.

Code: Select all


02-22 15:17:06.607 E/AppCenterCrashes(20449): Unhandled Exception from source=AndroidEnvironment
System.InvalidCastException: Specified cast is not valid.
	at Steema.TeeChart.Tools.NearestPoint.MouseEvent (Steema.TeeChart.MouseEventKinds kind, Steema.TeeChart.Drawing.MouseEventArgs e, Steema.TeeChart.Drawing.Cursor& c) [0x0005b] in <f7c2f20fd8914905b8e049dc591c50a8>:0 
	at Steema.TeeChart.Chart.BroadcastMouseEvent (Steema.TeeChart.MouseEventKinds kind, Steema.TeeChart.Drawing.MouseEventArgs e, Steema.TeeChart.Drawing.Cursor& c) [0x00023] in <f7c2f20fd8914905b8e049dc591c50a8>:0 
	at Steema.TeeChart.TChart.OnMouseMove (Android.Views.MotionEvent e) [0x00089] in <4db77ad85a1749be9de93ae5cb78efb5>:0 
	at Steema.TeeChart.TChart.OnTouchEvent (Android.Views.MotionEvent e) [0x008bd] in <4db77ad85a1749be9de93ae5cb78efb5>:0 
	at Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x0000f] in <b24a608f3e284c3e8fda498590205f05>:0 
	at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.59(intptr,intptr,intptr)
	
	**System.InvalidCastException:** 'Specified cast is not valid.'

Visual Studio v16.8.6
Xamarin.Forms v5.0.0.2012
Steema.TeeChart.NET.Xamarin.Forms v4.2021.2.18

Xamarin.Android SDK 11.1.0.26
Xamarin.iOS SDK 14.10.0.4

Note: My phone was updated to Android 11, so the app must be compiled against Android 11 in order to debug.

TLC
Newbie
Newbie
Posts: 45
Joined: Mon Apr 08, 2019 12:00 am

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by TLC » Mon Feb 22, 2021 9:41 pm

Also, the previous exceptions still over on page creation.
Capture.PNG
Capture.PNG (67.1 KiB) Viewed 463 times

Pep
Site Admin
Site Admin
Posts: 3213
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: System.ArgumentNullException Value cannot be null. Parameter name: type

Post by Pep » Thu Feb 25, 2021 2:27 pm

Hello,
**System.InvalidCastException:** 'Specified cast is not valid.'
Yes, you're correct, it was a bug which we've already fixed it.
We've just upload a new nuget version that includes the fix.
Also, the previous exceptions still over on page creation.
About this page problem I cannot reproduce the problem here using the latest versions of TeeChart for Xamarin.Forms and Xamarin.Forms.
Please, check if the problem also happens in a new clean project.

Post Reply