From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to include errorbar in WPF graph?

Solved!
Go to solution

Hello,

I'm looking for examples of error bar included in WPF graph control.

 

thanks

 

0 Kudos
Message 1 of 6
(5,596 Views)

Hi Gaspard,

 

What kind of data are you manipulating ?

 

Regards,

 

0 Kudos
Message 2 of 6
(5,583 Views)

Hi again,

 

you will find on the link below an example of error bar graph in Measurement Studio:

http://zone.ni.com/devzone/cda/epd/p/id/430

 

This example program creates error bars on a Measurement Studio .NET graph using extensibility.

 

Hope it will help 😉

 

Regards,

0 Kudos
Message 3 of 6
(5,570 Views)

Hi,

 

Thank you for your response.

I use regularly error bar for NI ScatterGraph ctrl in Windows form and the class ErrorBarPlot (like in your example). With WPF form, the Ni graph control does not show error bar facilities like scatterGraph . Do you know a possibility to add error bar on WPF graph or WritableGraph? I have perhaps missed a part of Graph control and the associated xaml  option.

 

regards

0 Kudos
Message 4 of 6
(5,563 Views)
Solution
Accepted by topic author gaspard

You haven’t missed anything: error bars are one of the features from Windows Forms that we did not have time to implement for the first version of the WPF graph controls.


Attached is a quick demonstration of a custom error bar renderer for the WPF graph. From XAML, you can use it in a plot like so:


    <ni:Graph Name="graph">
        <ni:Graph.Plots>
            <ni:Plot>
                <ni:PlotRendererGroup>
                    <my:ErrorBarRenderer />
                    <ni:LinePlotRenderer Stroke="Green" />
                </ni:PlotRendererGroup>
            </ni:Plot>
        </ni:Graph.Plots>
    </ni:Graph>


The example uses hard-coded values, but you should be able to adapt the code to fit your situation.

~ Paul H
Message 5 of 6
(5,556 Views)

Thanks Phansen

 

This is a good starting code to study error bar in WPF graph control.

0 Kudos
Message 6 of 6
(5,546 Views)