WPF Charting with Dynamic Data Display: How can I show a regression line?

RoelF picture RoelF · Aug 12, 2011 · Viewed 7.2k times · Source

I'm using Dynamic Data Display (D3) to render a few simple LineSeries on a chart:

<d3:ChartPlotter>
    <d3:CursorCoordinateGraph/>
    <d3:LineGraph DataSource="{Binding SelectedGraphValues}"/>
    <!-- ... Snip ...-->
</d3:ChartPlotter>   

here is a small example graph:
example chart
* image from http://dynamicnotions.blogspot.com/2009/05/linear-regression-in-c.html

Is there a simple way to do this with D3? Or do I have to make the calculations myself? I just want to check before I reinvent the wheel here :-)

D3 is a very neat library, altough it's lacking a bit in documentation...

Answer

RoelF picture RoelF · Aug 30, 2011

After some research and going through samples from DynamicDataDisplay, I guess it's not built in (could've been though, there's a lot of stuff in that library!)

So I just created a new LineGraph and a new ObservableDataSource to bind it to, and calculated the regression myself.