WPF Charting Documentation - SciChart WPF Charts SDK v5.x
SciChart 2D Troubleshooting

Error and Exception Handling

Blank Chart / Why Doesn’t my Chart Draw?

SciChart has a neat feature to inform you the reason if and when the chart doesn’t draw.

To enable this feature, set SciChartSurface.DebugWhySciChartDoesntRender = true.

SciChartSurface.DebugWhySciChartDoesntRender = true
Copy Code
var sciChartSurface  = new SciChartSurface();
// Default is false. Turn debug output on here
sciChartSurface.DebugWhySciChartDoesntRender = true;

Or, in XAML

SciChartSurface.DebugWhySciChartDoesntRender = true
Copy Code
<s:SciChartSurface DebugWhySciChartDoesntRender="True"/>

Renderer Error Codes

The RendererErrorCodes which include typical reasons why SciChart doesn’t render and their solutions are given below:

Renderer Debug Message

Solution

Because none of the SciChartSurface.RenderableSeries has a DataSeries assigned

Please ensure that at least one of the RenderableSeries has a DataSeries.

See the SciChartSurface.RenderableSeries and RenderableSeries.DataSeries properties

Because the SciChartSurface.RenderableSeries collection is null or empty

Please ensure that you have a not null or empty SciChartSurface.RenderableSeries collection

Because the SciChartSurface.RenderSurface is null

Please ensure that the SciChartSurface.XAxes and SciChartSurface.YAxes properties have been set,

 e.g. check for binding errors if using MVVM.

Because the SciChartSurface has not YAxes.

Please ensure that SciChartSurface.YAxis is set, or SciChartSurface.YAxes has at least one axis.

Because the SciChartSurface has no XAxes.

Please ensure the SciChartSurface.XAxis is set, or the SciChartSurface.XAxes has at least one axis.

Because the SciChartSurface Viewport Size is not valid (e.g. 0 sized)

This shouldn't happen, but if it does, please ensure that the chart has a non-zero size. If you are really stuck,

contact us

Because the VisibleRange on one or more X or Y Axes is null, zero, or undefined

Please see the KB Article on AutoRange. SciChart's default mode will try to AutoRange once when the chart

 is first rendered. If there is no data, it won't be able to form a valid VisibleRange. Also this error can occur if

you set the Axis.VisibleRange equal to

Because one or more Warnings occurred during rendering

This error code does not prevent drawing but can yield more information about non-fatal errors. Warning text will

 be appended after the error message.

Because the RenderableSeries Collection is null or empty and you are using CategoryDateTimeAxis

Simply put, because you are using a CategoryDateTimeAxis and there are no RenderableSeries. This axis type requires

 series to measure the size of the data on the chart.

Because the TickProvider on one or more X or Y Axes is null

By default, the XAxis.TickProvider and YAxis.TickProvider properties are set to default values that calculate axis tick

(label, gridline) intervals. If this property is null, e.g. unintentionally set to null, or you have a binding error on this

 property, then this will prevent the chart from drawing.

Exception Logging

SciChart also outputs exceptions that occur during rendering to the console window. Under normal operation, there shouldn’t be any exceptions, but if you notice an unusual slowdown in performance, or the chart is blank or partially drawn, turn on the DebugWhySciChartDoesntRender feature and check the console output window in Visual Studio.

Alternatively, if you wish to get a callback when an exception occurs (e.g. for logging, or for warning your development team or users when something went wrong), you can handle the SciChartSurfaceBase.OnRenderException event.

Exception Logging
Copy Code
var sciChartSurface  = new SciChartSurface();
sciChartSurface.OnRenderException += (s,e) =>
{
   Trace.Write("Caught an exception in SciChart!\r\n" + e.Exception.Message);
};

Verbose Console Logging

SciChart features a verbose console logger which we recommend only using if you want to be notified about absolutely everything that occurs within the SciChart rendering pipeline.

Verbose Console Logging
Copy Code
private class OutputWindowLogger : ISciChartLoggerFacade
{
       public void Log(string formatString, params object[] args)
       {
             Debug.WriteLine(formatString, args);
       }
}

// To enable verbose console logging use this code
// WARNING: This will come at a considerable performance cost
SciChartDebugLogger.Instance.SetLogger(new OutputWindowLogger());
SciChartDebugLogger.Instance.WriteLine("Hellow World!");

 

Rendering / Display Issues

Troubleshooting Glitches and Flickering with Software Renderers

Some users report glitches, flickering or a freezing screen when using the software renderers. We have identified that some graphics hardware, particularly Intel HD GPUs, has a bug which affects the WPF WriteableBitmap class.

This is reported here and there is a test project which can demonstrate the issue without SciChart classes.

http://www.scichart.com/questions/question/zoom-not-working-properly-on-one-single-computer

This can be fixed by updating Intel HD Graphics Drivers to the latest version.

Troubleshooting Glitches and Flickering in DirectX

Some users report glitches and flickering when using the DirectX hardware renderer. The first thing we suggest is that people upgrade their graphics drivers as out of date Graphics drivers can be a cause of glitches in our Direct3D10RenderSurface.

SciChart uses the Microsoft class D3DImage to composite (mix) DirectX10/11 content with WPF. On some older graphics hardware, the D3DImage implementation is buggy and can cause dropped frames or glitching.

To resolve this, we have an alternative method to composite DirectX10/11 with WPF. This is much more reliable, but it is also slower leading to a slight (usually not noticeable) slowdown in refresh rate. To enable the alternative composition, please set the static property Direct3D10RenderSurface.UseAlternativeFillSource somewhere in your code:

Troubleshooting Glitches and Flickering in DirectX
Copy Code
// Disables hardware accelerated composition of DirectX with WPF
// Slightly slower refresh rate but resolves rare issues with dropped frames or glitching
// on some graphics hardware
Direct3D10RenderSurface.UseAlternativeFillSource = true;

Fallback from DirectX to Software Rendering

Please see Direct3D10RenderSurface , about the Direct3D10RenderSurface. This shows some techniques to fallback from Hardware Rendering to Software rendering when DirectX10/11 hardware is not available.

SciChart supports DirectX over Remote Desktop, and when configured correctly, will autodetect hardware and gracefully fallback to software rendering when DirectX10/11 hardware is not available. SciChart will also detect errors which occur in DirectX and can optionally fallback to software rendering in this case. 

 

 

 


SCICHART ® is a Registered Trademark in the UK, US and EEC. Copyright SciChart Ltd 2011-2018.

Email us to give feedback!