Is there a Smoothing option?

Jan 10, 2011 at 8:48 PM

I am using a line graph and would like to turn smoothing on. Is there a way to do this or do I have to perform my own smoothing method on the data source, then populate the graph?

I could not find any reference to smoothing in the library or samples. Thanks.

Jan 11, 2011 at 6:39 PM

You can add filters to a line graph, to preprocess the points, perhaps you could write a custom filter that smooths the points.

By the way, latest source and discussions are now at http://d3future.codeplex.com.

Jim

Jan 11, 2011 at 8:11 PM

Thanks Jim. Is there a sample of this anywhere? I have looked all over in the nightlies and all sample folders and can't seem to find one. Thanks.

Jan 12, 2011 at 1:38 PM

You want a sample of a filter?

Jan 13, 2011 at 3:15 AM

Yes, that would be great. I don't know how to create/use/apply a filter. Thanks

Jan 13, 2011 at 1:33 PM

Search the source for FrequencyFilter. I would just use that as an example.

Jan 15, 2011 at 3:27 PM

I am using MVVM and have my line graph source bound in xaml like so:

<d3:LineGraph x:Name="lineGraphCandela" DataSource="{Binding Path=IntensityData}" Stroke="Red"/>


How can I apply a filter if I am not adding line graphs like they do in the sample here:
plotter.AddLineGraph(CreateCurrencyDataSource(dj65), colors[0], 1, "Dow Jones 65 Composite");

Inside the AddLineGraph method is where the filter is applied. since I am using binding, I never get inside that method and my filter won't be applied.

Any suggestions? Thanks.

Jan 18, 2011 at 2:04 PM

You just need to add it to the filters collection (Filters property), I'm doing it in code but you should be able to do it in XAML.