cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot y value given index in Dynamic Graph Widget?

BParh.1
Senior III

It seems in Dynamic Graph widget, the only way to plot data is by:

addDataPoint(float y)

which automatically just add a data point to the next index from previous plot. But this might not suitable for real time monitoring.

In real time monitoring, we want to position the data according to timeline of x axis. So if for some reason say we miss acquiring data for two beats, then the next plot should not be on next index, instead it should be on next index + 2. Is there anyway we can do this? i.e. plotting the data given index so like:

addDataPoint(int index)

3 REPLIES 3
ktrofimo
Senior III

You may:

1) add same value twice

or

2) take source code of the graph class, extend it with required functionality and use as a custom widget

BParh.1
Senior III

Thank you @ktrofimo​ , I am interested approach 2. Could you tell me what is the graph class name to extend and what class member associated with the index plotting?

DynamicGraph class itself is not​ published in sources, but it consists of many elements. For scrolling graphs data is stored in GraphScroll class with private yValues[CAPACITY] member. You might try to inherit your own class based on GraphScroll class, but he problem is that yValues[] array is declared as private and I see no methods for accessing this data. Probably it has to be completely your own custom widget.