WPF Charting Documentation - SciChart WPF Charts SDK v5.x
The Error Bars Type

Error Bars are provided by the FastErrorBarsRenderableSeries type. This accepts data from a HlcDataSeries (X,Y, ErrorHigh, ErrorLow) and renders error bars above and below the Y-value.

NOTE: For info about XyzDataSeries, as well as other DataSeries types in SciChart, see DataSeries API

To declare a FastErrorBarsRenderableSeries, use the following code:

Declare a FastErrorBarsRenderableSeries in Xaml / Code Behind

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

    <s:SciChartSurface.RenderableSeries>
        <s:FastErrorBarsRenderableSeries x:Name="rSeries" Stroke="GreenYellow"
                StrokeThickness="1"
                AntiAliasing="False"
                DataPointWidth="0.8"/>
    </s:SciChartSurface.RenderableSeries>

    <!--  XAxis, YAxis omitted for brevity  -->
   
</s:SciChartSurface>

// Code Behind, e.g. in OnLoaded event handler, set the DataSeries
var hlcDataSeries = new HlcDataSeries<double, double>();

// FastErrorBarsRenderableSeries expects data in the format X,Y plus High (error high), Low (error low)
hlcDataSeries.Append(0, 0, 0.5, -0.5);
hlcDataSeries.Append(1, 1, 1.5, 0.8);
hlcDataSeries.Append(2, 0.5, 0.7, 0.4);
hlcDataSeries.Append(3, 0.7, 0.6, 1.0);

rSeries.DataSeries = hlcDataSeries;

Declare a FastErrorBarsRenderableSeries in Pure Code

Declare a FastErrorBarsRenderableSeries
Copy Code
// Declare the scichartsurface
var sciChartSurface = new SciChartSurface();
// ...
// Declare and add a Error Bars Series
var errorBarsSeries = new FastErrorBarsRenderableSeries()
{
    Stroke = Colors.GreenYellow,
    AntiAliasing = false,
    DataPointWidth = 0.8,
    StrokeThickness = 1,
};
// Set some data
// FastErrorBarsRenderableSeries expects data in the format X,Y plus High (error high), Low (error low)
hlcDataSeries.Append(0, 0, 0.5, -0.5);
hlcDataSeries.Append(1, 1, 1.5, 0.8);
hlcDataSeries.Append(2, 0.5, 0.7, 0.4);
hlcDataSeries.Append(3, 0.7, 0.6, 1.0);

errorBarsSeries.DataSeries = hlcDataSeries;

 

NOTE: You can also declare RenderableSeries 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!