Fast Bitmap Series in WinUI Chart

15 Apr 20215 minutes to read

A fast bitmap series is a special kind of series that can render a collection with huge number of data points using WriteableBitmap.

FastLineBitmap Chart

FastLineBitmapSeries displays a series of line segments, rendered using WriteableBitmap. The advantage of FastLineBitmapSeries is, it renders a million data point in a fraction of seconds.

The following code example shows how to use the fast line bitmap series.

<chart:FastLineBitmapSeries ItemsSource="{Binding Data}"

XBindingPath="XValue" YBindingPath="YValue"/>
FastLineBitmapSeries series = new FastLineBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue"

};

chart.Series.Add(series);

FastLineBitmap chart type in WinUI

NOTE

As it was rendered using bitmap, there might be some jagged lines at the edges. This is can be reduced using the EnableAntiAliasing property.

<chart:FastLineBitmapSeries EnableAntiAliasing="True" ItemsSource="{Binding Data}"

XBindingPath="XValue" YBindingPath="YValue"/>
FastLineBitmapSeries series = new FastLineBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue",

    EnableAntiAliasing = true

};

chart.Series.Add(series);

AntiAliasing support for fast line bitmap chart in WinUI

FastColumnBitmap Chart

FastColumnBitmapSeries is used to boost up the performance of the column series.

<chart:FastColumnBitmapSeries ItemsSource="{Binding Data}" 

XBindingPath="XValue" YBindingPath="YValue"/>
FastColumnBitmapSeries series = new FastColumnBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue"

};

chart.Series.Add(series);

FastColumnBitmap chart type in WinUI

FastBarBitmap Chart

FastBarBitmapSeries is used to boost up the performance of the bar series.

<chart:FastBarBitmapSeries ItemsSource="{Binding Data}" 

XBindingPath="XValue" YBindingPath="YValue"/>
FastBarBitmapSeries series = new FastBarBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue"

};

chart.Series.Add(series);

FastBarBitmap chart type in WinUI

FastScatterBitmap Chart

FastScatterBitmapSeries is used to render high number of scatter points. The ScatterHeight and ScatterWidth are also available as in ScatterSeries. ShapeType is used to change the rendering shape of fast scatter bitmap series. The available shapes are Cross, Diamond, Ellipse, Hexagon, InvertedTriangle, Pentagon, Plus, Rectangle and Triangle.

<chart:FastScatterBitmapSeries ItemsSource="{Binding Data}"                         

XBindingPath="XValue" YBindingPath="YValue" 

ScatterHeight="7" ScatterWidth="7"/>
FastScatterBitmapSeries series = new FastScatterBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue",

    ScatterHeight = 7,

    ScatterWidth = 7

};

chart.Series.Add(series);

FastScatterBitmap chart type in WinUI

FastStepLineBitmap Chart

FastStepLineBitmapSeries is the high performance version of step line series.

<chart:FastStepLineBitmapSeries ItemsSource="{Binding Data}"

XBindingPath="XValue" YBindingPath="YValue" />
FastStepLineBitmapSeries series = new FastStepLineBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue"

};

chart.Series.Add(series);

FastStepLineBitmap chart type in WinUI

The anti aliasing mode can be enabled using the EnableAntiAliasing property of FastStepLineBitmapSeries as shown in the following code sample.

<chart:FastStepLineBitmapSeries EnableAntiAliasing="True" ItemsSource="{Binding Data}"

XBindingPath="XValue" YBindingPath="YValue" />
FastStepLineBitmapSeries series = new FastStepLineBitmapSeries()
{

    ItemsSource = new ViewModel().Data,

    XBindingPath = "XValue",

    YBindingPath = "YValue",

    EnableAntiAliasing = true

};

chart.Series.Add(series);

AntiAliasing support for FastStepLineBitmap chart type in WinUI