Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

scroll bar in waveformGraph

How to add the scroll bar in the waveformGraph display (Measurement Studio, C#) in order to let user view the previous waveform?
0 Kudos
Message 1 of 7
(4,639 Views)
I dont know if there is a simple way for adding a scrollbar to a graph. You can just play with your graph :


protected void ScrollBarValueChangedEventHandler( object sender, System.EventArgs e )
{
// compute the new range

_xAxis.Range = new NationalInstruments.UI.Range( rangeMinimum, rangeMaximum );
}


I wanted to send you my own code but I playing with zooms and dynamic / static modes (the points are charted while the range does not move and the scollbar auto updates his size) so it is... quite hard to understand 🙂

gl !


Pipo
0 Kudos
Message 2 of 7
(4,628 Views)
Check out this thread for some more ideas.

You can create a user control that has the waveformgraph and a scrollbar on there. And change the range according to the scrolling. This way, the scroll bar will look native to the graph.

Hope this helps
Bilal Durrani
NI
0 Kudos
Message 3 of 7
(4,622 Views)
You can also view the previous waveforms by panning the plot area of the graph. To enable panning set the InteractionMode property to PanX and PanY. At run-time, you can then hold the Control (CTRL) key down in the plot area while dragging the mouse to accomplish panning.
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 4 of 7
(4,615 Views)
Thanks for the info!

Could you provide some sample program (eg. have the scroll bar in the dynamic chart - changing data Vs time)???
0 Kudos
Message 5 of 7
(4,599 Views)
Hello,

Here is an example of how to add scrollbars to your application. The example uses a vertical scrollbar added to the graph to scroll through the y data. Take a look at this example and
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 6 of 7
(4,584 Views)
I have tried to use this sample.

If I want to have the horizontal scrollbar, what's the difference in the code?

Also, as incorporated the userControl cs class into the program, it run, then it has the error in the line, the line of coding, as follows:

WaveformGraph waveformGraph = userControl11.waveformGraph1;

Don't know why contained some errors, pls kindly advise.

Thx!
0 Kudos
Message 7 of 7
(4,567 Views)