Functionality questions

Dec 18, 2009 at 4:27 PM
Edited Dec 18, 2009 at 8:35 PM

Hi,

I am looking into charting/graphing packages and have some questions about D3 and whether it would be a good choice for me.  Basically, I am drawing spectra- pretty simple x,y line chart, with a data size of about 75,000 points per spectra.  So would someone be so kind as to tell me whether D3 can do these things:

1.  Restrict the zoom out and pan- if my data starts at x=5000, and ends at x=75,000, I dont want users to pan or zoom out to see 0 or 100,000 on the X axis (same for Y). 

2. Add multiple datasources.  I need to draw the spectra, say in black, and then draw curves over some of the peaks in different colors to highlight them.

3. Switch data sources.  Since the data can be smoothed (for example), a user can click a checkbox that would switch the view between raw and smoothed data.

4. Remove the grid background

5. Enable/disable the crosshairs

6. Autoscale on the Y axis

Can D3 do all of these things?  If so, awesome!  Are there examples for any of these?  (Im sure there are, but there are so many samples!  Hard to tell where to find stuff)

I am doing all of this with MVVM as well, so as part of exploring I have been trying to figure out how to add multiple data sources to a simple ChartPlotter via a binding in xaml but as yet I havent found it.  Also, since I cannot draw 75,000 data points, I would definately need to filter the data- it seems there is some nice filtering stuff here, but Im not sure how to use it yet.

I would most appreciate any help or suggestions!

Dec 18, 2009 at 6:36 PM

I am looking into charting/graphing packages and have some questions about D3 and whether it would be a good choice for me.  Basically, I am drawing spectra- pretty simple x,y line chart, with a data size of about 75,000 points per spectra.  So would someone be so kind as to tell me whether D3 can do these things:

1.  Restrict the zoom out and pan- if my data starts at x=5000, and ends at x=75,000, I dont want users to pan or zoom out to see 0 or 100,000 on the X axis (same for Y). 


use something like  plotter.Viewport.FitToViewRestrictions . See discussion:71063.

2. Add multiple datasources.  I need to draw the spectra, say in black, and then draw curves over some of the peaks.

 
use plotter.AddLineGraph(yourNewDataSource,...) to add a new graph to the same plot.

3. Switch data sources.  Since the data can be smoothed, a user can click a checkbox that would switch the view between raw and smoothed data.


I think that plotter.children.Remove should do the trick
 

4. Remove the grid background

I don't know  :)
 

5. Enable/disable the crosshairs

see an example in the samples of v0.3
 

Can D3 do all of these things?  If so, awesome!  Are there examples for any of these?  (Im sure there are, but there are so many samples!  Hard to tell where to find stuff)


begin by the samples of v0.2 (basics).


Cheers!
Dec 18, 2009 at 9:24 PM

Excellent, thanks so much for the info!

Since I am using MVVM, I found an example here with multiple linecharts added to a chartplotter- seems very cool.  Is there a way to do the Autoscale Y thing?

Also what is the best example of data filtering?  The million points on a plot?

Excellent packages, thanks!