SciChart WPF 2D Charts > 2D Chart Types > The Digital Line Series Type
The Digital Line Series Type

Digital (Step) Line Series are provided by the FastLineRenderableSeries type, when the FastLineRenderableSeries.IsDigitalLine property is true.

Examples for the Digital Line Series can be found in the SciChart WPF Examples Suite which can be downloaded from the SciChart Website or our SciChart.WPF.Examples Github Repository.

To declare a FastLineRenderableSeries with DigitalLine flag, use the following code:

Declare a FastLineRenderableSeries in Xaml / Code Behind

Declare a FastLineRenderableSeries
Copy Code
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart" -->
<s:SciChartSurface>

    <s:SciChartSurface.RenderableSeries>
        <s:FastLineRenderableSeries x:Name="lineSeries" AntiAliasing="True"
                                     StrokeThickness="1" StrokeDashArray="2 2"
                                     Stroke="OrangeRed" IsDigitalLine="True"/>
    </s:SciChartSurface.RenderableSeries>

    <!--  XAxis, YAxis omitted for brevity  -->

</s:SciChartSurface>

// Code Behind, e.g. in OnLoaded event handler, set the DataSeries
var dataSeries = new XyDataSeries<double, double>();
for(int i = 0; i < 100; i++)
       dataSeries.Append(i, Math.Sin(i*0.2));
lineSeries.DataSeries = dataSeries;

Declare a FastLineRenderableSeries in Pure Code

Declare a FastLineRenderableSeries
Copy Code
// Declare the scichartsurface
var sciChartSurface = new SciChartSurface();
// ...
// Declare and add a Line Series
var lineSeries = new FastLineRenderableSeries()
{
    Stroke = Colors.OrangeRed,
    StrokeThickness = 2,
    AntiAliasing = true,
    StrokeDashArray = new double[] { 2, 2 },
    IsDigitalLine = true,
};
sciChartSurface.RenderableSeries.Add(lineSeries);

// Set some data
var dataSeries = new XyDataSeries<double, double>();
for(int i = 0; i < 100; i++)
    dataSeries.Append(i, Math.Sin(i*0.2));
lineSeries.DataSeries = dataSeries;

 

NOTE: You can also declare RenderableSeries using full MVVM (series ViewModels). Please see MVVM DataSeries / RenderableSeries API for more details.

See Also