LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronized scroll bar on graphs

Hi together,

 

I have a program with several graphs. Is it possible to syncronize the graphs so that all graphs scroll if I scroll on the scroll bar of on graph? I remeber that this is at least possible in LabView...

 

Cheers

0 Kudos
Message 1 of 4
(3,099 Views)

@HansiWWW wrote:

 

... if I scroll on the scroll bar of on graph?...


 

In CVI graphs don't have a scroll bar. What you can do is pan the graph area with the mouse, and you can programmatically catch this event and read the new axis range in order to adjust the axis range of other graphs.

 

0 Kudos
Message 2 of 4
(3,090 Views)

As an alternative to Wolfgang solution, you can add your own scrollbar to the graphs using the scrollbar instrument driver, located in \toolslib\custctrl folder in your CVI installation. Look at the sample program in samples\userint\custctrl\scrollbar folder.

Adding a scrollbar to each graph and handling scrolling events from the controls you can syncronize your graphs. This of course once the graph has been zoomed so that only part of the plots are visible.

 

 

This is what CVI can offer for graphs. If you are usnig stripcharts, instead, then you can have a scrollbar shown when they are paused. In this moment, the chart callback should receive EVENT_HSCROLL events when the user operates on the scrollbar. In this moment you can probably get the X-axis scale and apply the same to the other charts. It is to be tested, though: I have nevere tried such a mechanism.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,088 Views)

Sorry for posting to a really old conversation.  But I'm working through this right now and ran across an excellent example project for Wolfgang's suggestion in the CVI folder:

 

C:\Users\Public\Documents\National Instruments\CVI2013\samples\userint\GraphAnnotations.cws

0 Kudos
Message 4 of 4
(2,807 Views)