question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Invalid Cast Exception" ...all of a sudden

See original GitHub issue

Implementing a donutChart in my android application and I’m getting an invalid Cast exception error all of a sudden after it worked fine before. What could be the issue? Screen shot attached.

Error is occurring on: chart = new DonutChart(){Entries = chartSeries };

chart series is Entry array: chartSeries = new Microcharts.Entry[] { new Microcharts.Entry (A) { Label = "100-75", ValueLabel = MakeAPercentage(A, total), Color = SKColor.Parse("#00D83E") }, new Microcharts.Entry(B) { Label = "75-50", ValueLabel = MakeAPercentage(B, total), Color = SKColor.Parse("#64BCFF") }, new Microcharts.Entry(C) { Label = "50-25", ValueLabel = MakeAPercentage(C,total), Color = SKColor.Parse("#FFD64A") }, new Microcharts.Entry(D) { Label = "25-0", ValueLabel = MakeAPercentage(D,total), Color = SKColor.Parse("#D30D1B") } screen shot 2017-12-26 at 9 18 25 am

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dzataracommented, Dec 27, 2017

@aloisdeniel Thanks for responding After much sweat and equal amounts of caffeine, I discovered the error was actually from the xaml code and NOT the Microcharts element. Happy to say its working fine now. screenshot: screen shot 2017-12-27 at 9 58 34 am

Thanks again and awesome work with the package!

0reactions
Nixon-Josephcommented, Feb 16, 2019

@gunjanddave If you’re still having a problem, please create a new issue with as much information as you can provide. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve Invalid Cast exception?
I am facing an issue as invalid cast exception in my razor view. I have created a log in razor for authentication purpose...
Read more >
Why is this code suddenly giving InvalidCastException
All of a sudden the following error message is being produced - I've shown the code in question as well. It was working...
Read more >
InvalidCastException Class (System)
An InvalidCastException exception is thrown when the conversion of an instance of one type to another type is not supported. For example, attempting...
Read more >
Handling the ClassCastException Runtime Exception in Java
The ClassCastException in Java happens when the JVM tries to cast an object to a class (or in some instances, an interface) and...
Read more >
Invalid cast exception · Issue #931 · dotnet/upgrade-assistant
The bug is that the analyzer doesn't properly handle anonymous types and ends up thinking anonymous type members with names equal to types...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found