SciChart ships with three four(!) five(!!) swappable renderer plugins which perform the final draw for Series and Axis Gridlines on the SciChartSurface.RenderSurface. These plugins are detailed below.
We provide three kinds of services: Good, Cheap or Fast. Pick two!
Visual Xccelerator Renderer
This supercedes the Direct3D11RenderSurface and provides extremely fast performance for complex, big-data charts.
You can find out how to enable it at the page Enabling the Visual Xccelerator Engine.
For other rendering plugins, read below...
HighSpeedRenderSurface
The HighSpeedRenderSurface was the first plugin to be developed for SciChart. Based on the open-source WriteableBitmapEx library, the HighSpeedRenderSurface provides a quick, integer coordinate, bitmap-based engine for drawing series fast in software.
Lines drawn with the HighQualityRenderSurface appear jagged or aliased
Enabling the HighSpeedRenderSurface
The HighSpeedRenderSurface is enabled by default. To explicitly set this as the active render surface, use the following code:
XAML
Enabling the HighSpeedRenderSurface |
Copy Code |
---|---|
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <s:SciChartSurface> <s:SciChartSurface.RenderSurface> <s:HighSpeedRenderSurface/> </s:SciChartSurface.RenderSurface> </s:SciChartSurface> Or, <!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <s:SciChartSurface s:RenderSurfaceExtensions.RenderSurfaceType="HighSpeed"> </s:SciChartSurface> |
Code
Enabling the HighSpeedRenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); sciChartSurface.RenderSurface = new HighSpeedRenderSurface(); |
Or,
Enabling the HighSpeedRenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); RenderSurfaceExtensions.SetRenderSurfaceType(sciChartSurface, "HighSpeed"); |
HighQualityRenderSurface
Lines drawn with the HighQualityRenderSurface appear smooth and Antialiased
The HighQualityRenderSurface is another software renderer, based on the open-source AggSharp library, licensed under the MIT license, which provides sub-pixel rendering and high-quality alpha blending. This is by far the visual best quality of all the renderer plugins, but it is also one of the slowest. Not suitable for high-performance real-time work, it can still give good performance in many business applications and real-time applications with lower point-counts.
Enabling the HighQualityRenderSurface in XAML
Enabling the HighQualityRenderSurface |
Copy Code |
---|---|
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <s:SciChartSurface> <s:SciChartSurface.RenderSurface> <s:HighQualityRenderSurface/> </s:SciChartSurface.RenderSurface> </s:SciChartSurface> Or, <!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <s:SciChartSurface s:RenderSurfaceExtensions.RenderSurfaceType="HighQuality"> </s:SciChartSurface> |
Code
Enabling the HighQualityRenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); sciChartSurface.RenderSurface = new HighQualityRenderSurface(); |
Or,
Enabling the HighQualityRenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); RenderSurfaceExtensions.SetRenderSurfaceType(sciChartSurface, "HighQuality"); |
Direct3D11RenderSurface
NOTE: The DirectX Renderer plugin is available to customers who have purchased SciChart WPF Enterprise or SciChart WPF SDK Enterprise products only.
The Direct3D11RenderSurface is a DirectX10/11 hardware accelerated renderer, which uses proprietary algorithms to render fast lines of any-thickness and polygons with Anti-aliasing. The Direct3D11RenderSurface provides sub-pixel quality equivalent to the HighQualityRenderSurface but also outperforms the HighSpeedRenderSurface on average 3.92x, with some test-cases outperforming software rendering by up to 40x. The Direct3DRenderSurface (at the time of writing) also outperforms all competitors to SciChart and some competitor charts by several orders of magnitude!
It does require a DirectX10 or 11 enabled Graphics Card, but fall-back to software is available when the GPU does not have sufficient features.
Lines drawn with the Direct3D10RenderSurface appear smooth, antialiased and are also very fast!
Enabling the Direct3D11RenderSurface in XAML
The following code sample will enable the DirectX Renderer plugin with automatic fall-back to a software renderer of your choice. Note that the DirectXHelper only applies DirectX renderer when the application is run, not in the Visual Studio designer.
Enabling the Direct3D11RenderSurface |
Copy Code |
---|---|
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <!-- where xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D" --> <s:SciChartSurface s3D:DirectXHelper.FallbackType="{x:Type s:HighQualityRenderSurface}" s3D:DirectXHelper.TryApplyDirectX="True"> </s:SciChartSurface> |
Enabling the Direct3D11RenderSurface in Code
Or, the following syntax is available if you want to enable DirectX in code.
Enabling the Direct3D11RenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); DirectXHelper.SetFallbackType(sciChartSurface, typeof(HighQualityRenderSurface)); DirectXHelper.SetTryApplyDirectX(sciChartSurface, true); |
Pre-checking Direct3D11RenderSurface Compatibility
SciChart DirectX compatibility can be checked using the Direct3D11CompatibilityHelper.
Pre-checking Direct3D10RenderSurface Compatibility |
Copy Code |
---|---|
If (!Direct3D10CompatibilityHelper.SupportsDirectX10) { bool hasGpu = Direct3D10CompatibilityHelper.HasDirectX10CapableGpu; Bool hasOs = Direct3D10CompatibilityHelper.IsSupportedOperatingSystem; MessageBox.Show("SciChart DirectX is not supported! The reason is because " + hasGpu == false ? "you don’t have a DirectX10 GPU" : hasOs == false ? "you don’t have Windows Vista or up" : "Unknown"); } |
Async Initialisation of Direct3D11
The DirectX engine requires a few seconds to initialize, especially in the debugger. To mask the time to initialize the DirectX engine, you can pre-initialize async in your application startup.
Async Initialisation of Direct3D10 |
Copy Code |
---|---|
var t = SciChart.Drawing.DirectX.Context.D3D11.Direct3D11RenderSurface.InitEngineAsync(); t.ContinueWith(task => { // On completion of initialization, this action will be called if (task.Result == true) { // Device supports Direct3D11RenderSurface } else { // Device does not support Direct3D11RenderSurface } }); |
Problems on certain Graphics Hardware
Certain graphics hardware can exhibit problems with the D3DImage – a Microsoft WPF class which allows DirectX content to be composed into a WPF application. Notably, some older Intel Integrated HD Graphics cards have problems with D3DImage.
We advise customers to update their graphics drivers if they experience any issues such as graphical glitching with SciChart WPF.
You can also force an alternative method to compose DirectX with WPF by setting the static flag
Direct3D10RenderSurface.UseAlternativeFillSource = true
This will force SciChart to use alternatives other than D3DImage causing a more stable experience on older GPU hardware.
Remote Desktop Compatibility
The Direct3D11RenderSurface is compatible with Remote Desktop (RDP).
XamlRenderSurface
NOTE: The XamlRenderSurface Renderer plugin is available in the SciChart WPF Enterprise and SciChart WPF SDK Enterprise products only.
The XamlRenderSurface renders everything to a WPF Canvas. This is useful when you want to export the chart to XPS (Scalable vector format) or print a high-quality screenshot. This render surface type is not recommended for real-time charting applications.
Enabling the XamlRenderSurface in XAML
Enabling the XamlRenderSurface |
Copy Code |
---|---|
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" --> <s:SciChartSurface> <s:SciChartSurface.RenderSurface> <s:XamlRenderSurface/> </s:SciChartSurface.RenderSurface> </s:SciChartSurface> |
Enabling the XamlRenderSurface in Code
Enabling the XamlRenderSurface |
Copy Code |
---|---|
var sciChartSurface = new SciChartSurface(); sciChartSurface.RenderSurface = new XamlRenderSurface(); |