WPF Charting Documentation - SciChart WPF Charts SDK v5.x
Renderer Plugins

SciChart ships with three four(!) swappable renderer plugins which perform the final draw for Series and Axis Gridlines on the SciChartSurface.RenderSurface. These plugins are detailed below.

https://pbs.twimg.com/media/CJZB4oCWUAASl29.png:large

We provide three kinds of services: Good, Cheap or Fast. Pick two!

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 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:RenderSurface>
      <s:HighSpeedRenderSurface/>
   </s: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:RenderSurface>
      <s:HighQualityRenderSurface/>
   </s: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 in the SciChart WPF Enterprise and 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

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:RenderSurface>
      <s3D:Direct3D10RenderSurface/>
   </s:RenderSurface>
</s:SciChartSurface>

Enabling the Direct3D11RenderSurface in Code

Or, the following syntax is preferable, as it automatically falls-back to software rendering if DirectX is not available.

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:RenderSurface>
      <s:XamlRenderSurface/>
   </s:RenderSurface>
</s:SciChartSurface>

Enabling the XamlRenderSurface in Code

Enabling the XamlRenderSurface
Copy Code
var sciChartSurface = new SciChartSurface();
sciChartSurface.RenderSurface = new XamlRenderSurface(); 

 

 

 


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

Email us to give feedback!