Jump to content
Software FX Community

How to catch a exception in ChartFX


bandcy

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. :)

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...