WPF Charting Documentation - SciChart WPF Charts SDK v5.x
The Line Series Type

Line Series are provided by the FastLineRenderableSeries type.

 

To declare a FastLineRenderableSeries 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"/>
    </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 },
};
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 FastLineRenderableSeries using full MVVM (series ViewModels). Please see  MVVM DataSeries / RenderableSeries API for more details

 

 

 


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

Email us to give feedback!