Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Zoom while graphing

I'm attempting to write the functionality into a graph such that the user can zoom while data is being added to the graph.  This functionality is available in the LabView graphing control, but I do not know if it is available in the C++ version.  I'm having trouble figuring out the graph state(s) and what the best way to accomplish my goal is.

I would like to add the functionality such that when a person zooms in on the graph while I'm still plotting, it resets the X and Y axis ranges to the ones selected by the zoom.  This functionality is available in the LabView graphing control through the scale key shown in the attached picture with a red arrow pointing to it.  When the highlighted button is selected, the graph leaves the autoscale mode and automatically adjusts the X-axis to always contain a certain range of data as the data is being plotted.  i.e. the most recent value and all values below that fall within 50 ticks on the X-axis.

When the user selects to zoom and zooms in, the X and Y axes adjust to fit the ranges selected by the zoom box.

Are these capabilities available in the ActiveX CNiGraph and what states are they?  There's more to this, but it will only complicate a seemingly simple question.
TIA
0 Kudos
Message 1 of 2
(3,677 Views)

Hi antadam,

 

Currently that functionality isn't directly implemented into the CNiGraph graph object like the LabVIEW graph object.  In this case you would need to write you own zooming code.  For Visual C++ 6.0, there are several TrackModes associated with the CNiGraph graph class. Open the help for this topic by browsing to Start >> Programs >> National Instruments >> Measurement Studio >> Help >> Measurement Studio Reference and then searching for TrackModes under the Index tab.  You will see there are several zoom options available. Also with the 7.1 version of this graph control, there is a zoom event that you can use that is fired as when CNiGraph is finished zooming. From that state you could get the maximum and minimum values for axes.  If you need to update your control, see this link.  You may also want to check out the Simple Graph and Axes examples located in the <MeasurementStudio>\VC\Examples\Ui\Graph folder. 

 

If you would like to make a product suggestion about having this feature built in like LabVIEW, you can submit suggestions at this link. Once at this link, click the Product Feedback option.

 

Hope this helps

!

Jonathan N.
National Instruments
0 Kudos
Message 2 of 2
(3,659 Views)