4

I'm new to oxyplot, and I'd like to know your opinion about this. I have to develop a software that plots a signal streamed in real time by an oscilloscope.

Let's say I want to capture 500 seconds at a sampling rate of 10.000 samples per second. Then I'll have, at the end of the capture, 5.000.000 points. That's too much information to be displayed.

I'd like to implement a solution like this: plot a constant number of points, it is to say, by default show all the x-axis, 0-500 seconds, but only display, for example, 10.000 points. And, if you zoom to 3-5 seconds, plot 10.000 points too.

The idea is that if you have the full x-axis, no matter how many points you plot, you won't be able to distinguish anything, so what's the point of plotting so many points?

I want to implement some kind of filter that, taking into account the sampling rate, decide how many points to plot depending on the x-axis. Let's say I'm going to capture 500 seconds, 10.000 points per second, so I will only have to plot:

500*10.000/x = 10.000 => x = 500, one point each 500 points.

Then, if I zoom in to the 3-6 seconds range:

(6-3)*10.000/x = 10.000 => x = 3, one point each 3 points.

If the zoom in range is less than one second, then plot all the points, in this example.

Any idea about where should I implement it? Any other better ideas?

I hope I've been clear. Thank you in advance for your help!

lyurealm
  • 113
  • 4
  • Personally I like the MVVM approach. Then you can bind oxyplot from xaml to a plotmodel you control. When catching the zoom event, then check the X axis to check what precision you need. I just answered here to another quesiton, it may help to start this implementation: https://stackoverflow.com/questions/43045617/styling-wpf-oxyplot-plotviews-in-xaml/50985824#50985824 – Mikitori Jun 22 '18 at 10:30

0 Answers0