Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to stack waveform in one graph

I am trying to stack 107 waveforms in one graph. I need to plot these to its depth (Y Axis is depth). That means the first wave will be plot at Y = 0, the next waveform will be plotted at Y = 0.1 (not 1). The third waveform will be plotted at Y = 0.2 (not 2). How do I do that?
0 Kudos
Message 1 of 2
(3,395 Views)
Do you mean a simple 2D graph? Try this, its a striaght mod of what you get in the Measurement Studio booklet.

CNiReal64Vector rvecWave;
CNiGraph m_graph;

.
.
.

// Creates a sine wave 100 pts long, amplitude 0.09.
CNiMath::SineWave(rvecWave, 100, 0.09)

m_graph.Plots.Item(1).PlotY(rvecWave); // Item(1) exists by default.

// Now add all the other plots.
for (int i = 2; i < 108; i++)
{
  m_graph.Plots.Add(); // Adds a new plot.
  m_wave.Scale(1, 0.1); // Adds the offset.
  m_graph.Plots.Item(i).PlotY(m_wave); // Plots the wave.
}

-Mike
0 Kudos
Message 2 of 2
(3,395 Views)