bandcy Posted November 9, 2009 Report Share Posted November 9, 2009 Hi~ I'm poor at English.. but I have a question. so I write a new post I'd like to catch a exception but I couldn't. for example when I set a value like this chart1.AxisX.LabelValue = double.PositiveInfinity; then OverflowException was occured. I try catch the exception... so I wrap the code with Try, catch try { chart1.AxisX.LabelValue = double.PositiveInfinity; } catch (OverflowException ex) { throw ex; } But unfortunately I couldn't. So.. I have to modify Program.cs file After set ThreadException, finaly I could catch a exception Exception was handled, but another problem has occured. I can not distinguish which one is chartFx's exception except e.Exception.StackTrace.IndexOf("ChartFX") . but I thought that's not good idea, and you can offer a better solution. Ask for opinions. thanks for reading this post. God bless Quote Link to comment Share on other sites More sharing options...
juanZ Posted November 10, 2009 Report Share Posted November 10, 2009 Hi, The problem is raised because the Chart FX does not allow positive or negative infinity values. You can use double.MaxValue instead. The chart needs concrete numerical value to plot so the infinity value will cause some trouble. Quote Link to comment Share on other sites More sharing options...
bandcy Posted November 10, 2009 Author Report Share Posted November 10, 2009 Thanks the answer. and one more question, can i catch the some trouble what you mentioned ? if it can't, i have to check the value(every seconds transmitted), before set so i thought.. it is better than (checking values before set) to (catching exceptions when it occured) i don't know the English is right. i hope you can understand what i want to say thanks God bless Quote Link to comment Share on other sites More sharing options...
juanZ Posted November 11, 2009 Report Share Posted November 11, 2009 Hi, Chart FX is not throwing specific exceptions for incorrect data that is being passed to the Chart. However I understand your concern. The best way to avoid this kind of issues is with some safe-programming. This means that, first validate data and inputs before assign them to the Chart. The chart should not fail with correct inputs. Ps. your english is going well. Quote Link to comment Share on other sites More sharing options...
bandcy Posted November 11, 2009 Author Report Share Posted November 11, 2009 Once again, Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.