From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

WPF Writable graph data point spacing

It seems like this should be obvious... And probably is if I only knew what terminology to look for. 

 

I am using the WPF NI Graph. The scales and data point spacing will very depending on settings but for simplicity lets say that I have a horizontal scale going from 0 to 40 and a double array of Y values with 4000 data points. So I have 100 points evenly spaced points for evey 1 increment.

 

How do I change the graphs point spacing so that the 4000 data points fit between 0 and 40?

 

I have the horizonal scale set to double but there doesn't appear to be a way to specify and interval or spacing.

 

 

0 Kudos
Message 1 of 3
(3,945 Views)

From your description, it sounds like you are providing a graph with a double[] of samples, and you want to specify a custom interval to replace the array index values currently used by the graph.


To do this, there are two basic approaches. You can use a collection that provides the appropriate position information explicitly (i.e. a Point[], ChartCollection<double,double>, or similar). Or you can implement a custom ScaleKind that transforms the incoming values before doing a standard mapping.

~ Paul H
Message 2 of 3
(3,934 Views)

Ok, thanks!  I hoped to avoid needing to explcitly create an array for horizonta data, but it is work fine.

 

Thanks again!

0 Kudos
Message 3 of 3
(3,901 Views)