SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

I purposely gave SciChart a bad axis ID with: fastLineRenderableSeries.YAxisId = “asdf”;

When I run my application within Visual Studio, Visual Studio throws this exception:

A first chance exception of type ‘System.InvalidOperationException’ occurred in Abt.Controls.SciChart.Wpf.dll. AxisCollection.GetAxisById(‘asdf’) returned no axis with ID=asdf. Please check you have added an axis with this Id to the AxisCollection

But when I run my compiled exe I don’t even get an unhandled exception error. SciChart simply doesn’t draw the chart. I want to catch this exception but my attempts to set up a try/catch have failed.

Is there a way for me to catch this sort of exception so I can log it?

  • You must to post comments
0
0

The exception is still thrown and caught inside our render loop.

Render loop exceptions are output to the console window. You can get more verbose output by setting the property SciChartSurface.DebugWhySciChartDoesntRender = true.

See Help! My Chart is Blank! Why Doesn’t SciChart Render?

SciChartSurface.DebugWhySciChartDoesntRender Console Output

We can’t allow exceptions that occur inside the render loop to be uncaught, as the render loop is processed asynchronously and any uncaught exceptions that occur here will just crash your whole app 🙂

Hope this helps,

Andrew

  • Dave Doerr
    So, if I understand your response, there is currently no way for me to log that error in my app. It would be nice is SciChart created something for this. For example, an event I can subscribe to that delivers the error message.
  • Andrew
    Yes that is correct, the exception occurs in an asynchronous part of the code, and is caught, so that your application remains unaffected.What do you want to validate here? Our intention of throwing at design time is to ensure that errors like this (which are usually developer errors) are caught at design time before the application is shipped.
  • Dave Doerr
    I'm creating a generic line chart that sets up axis, range, etc., based on data. Because of the many possible combinations of settings, I'm concerned that I could make a programming error that would elude me during testing. The ability to log the rendering error in the field could be an invaluable clue when debugging.
  • Andrew
    Aha, that makes sense. It would be little effort for us to add a callback, but I can't guarantee when we can do this, as any change has to be thoroughly tested.What I suggest as a stop-gap for you is create a watcher class which attaches to a SciChartSurface, subscribes to the rendered event, then checks each RenderableSeries.YAxisId, XAxisId exists in the SciChartSurface.XAxes, YAxes collection. You could get a notification immediately and allow you to catch issues early.
  • Dave Doerr
    Considering all the possible rendering errors, your stop gap would be a pretty big job. My users are all in house so a failure to render isn't a huge deal. Thanks for considering my request.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.