SciChart WPF 2D Charts > Troubleshooting > SciChart 2D Troubleshooting
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.

https://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 Visual Xccelerator Engine

Some users report glitches or blank chart when the Visual Xccelerator Engine is enabled. 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  VisualXcceleratorRenderSurface.

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 VisualXcceleratorRenderSurface.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
VisualXcceleratorRenderSurface.UseAlternativeFillSource = true;

Also, there is no waiting for the GPU to finish rendering by default. The frame buffer is copied immediately. This may cause glitching or blank chart issues on older and slower GPUs. However, the API allows to delay rendering until the frame buffer is filled. To enable this, please set the static property VisualXcceleratorRenderSurface.ForceStallUntilGPUIsIdle

Troubleshooting Glitches and Flickering in DirectX
Copy Code
// Postpones rendering until the GPU is idle to ensure that a frame has finished rendering
// This fixes flicker issues that can happen on older hardware
VisualXcceleratorRenderSurface.ForceStallUntilGPUIsIdle = true;

Both properties can be set together if needed.

Fallback from DirectX to Software Rendering

When the Visual Xccelerator Engine is enabled, the API allows to configure a fallback from Hardware rendering to Software rendering when DirectX10/11 hardware is not available. The VisualXcceleratorEngine.FallbackTypeProperty attached property allows to specify a software renderer to use as a fallback. List of all available renderers can be found in the Renderer Plugins. article.

Additionally, the VisualXcceleratorEngine.DowngradeWithoutExceptionProperty attached property allows to specify whether the fallback should be silent or an exception should be fired instead.

These properties should be set on a SciChartSurface instance, either in XAML or in code-behind:

Fallback from DirectX to Software Rendering
Copy Code
<s:SciChartSurface s:VisualXcceleratorEngine.IsEnabled="True"
                   s:VisualXcceleratorEngine.FallbackType="{x:Type s:HighQualityRenderSurface}"
                   s:VisualXcceleratorEngine.DowngradeWithoutException="True">
Fallback from DirectX to Software Rendering
Copy Code
// FallbackType means fallback to this renderer if DirectX is not supported
// DowngradeWithoutException=False means it will throw exception if you don't support DirectX, otherwise, silent downgrade
VisualXcceleratorEngine.SetFallbackType(sciChartSurface, typeof(HighQualityRenderSurface));
VisualXcceleratorEngine.SetDowngradeWithoutException(sciChartSurface, false);

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.

Troubleshooting Glitches and Flickering with DirectX Renderer (DEPRECATED)

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 (DEPRECATED)

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.