Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

using same axes setting for multiple plots

Hi,

I am developing with MS VS 2005 with Measurement 8.0.1 on Windows XP.

I am using the NI ScatterPlots and ScatterGraphs to display my measurement data. I turned on all the interaction modes, so the user can pan and zoom on the data currently displayed. In fact, I like how holding the ctrl or sift keys plus the left mouse button, the user can pan or zoom and while holding the ctrl or sift keys plus the right mouse button, the user can undo the pan or zoom.

Periodically, the system updates, the measurement data.

What I noticed is:
1. Each time new data is generated and displayed, the plot/graph returns to full screen.
2. I tried trapping all the axis range updates. I stored the axis min and max. Each time, the plot/graph is redrwan, I set the axis ranges to the values I stored. However, in doing this, the user lost the ability to undo all the pans and zooms completed with the previous displayed data. In addition, I must that is way is rather complex. Each time the graph is redrwan it appears to cause an axis range changed event--this is way I keep track up axis changes by pan and zoom. In addition, I had to add a full screen button because of the lost information.

My questions are:
1. Is there a simple (NI component administer) way to develop this?
2. What are the complex ways to do this?

in the plotting method:
                myPlot.PlotXY(xValues, yValues);
                if (FullScreen)
                {
                    FullScreen = false;
                }
                else
                {
                    myXAxis.Range = new Range(currentXAxisMin, currentXAxisMax);
                    myYAxis.Range = new Range(currentYAxisMin, currentYAxisMax);
                }
                myGraph.InteractionMode = (
                    GraphInteractionModes.ZoomX
                    | GraphInteractionModes.ZoomY
                    | GraphInteractionModes.ZoomAroundPoint
                    | GraphInteractionModes.PanX
                    | GraphInteractionModes.PanY
                    | GraphInteractionModes.DragCursor
                    | GraphInteractionModes.DragAnnotationCaption
                    | GraphInteractionModes.EditRange);

in the Axis_RangeChanged methods:
for x axis
                currentXAxisMin = myXAxis.Range.Minimum;
                currentXAxisMax = myXAxis.Range.Maximum;
for y axis
                currentYAxisMin = myYAxis.Range.Minimum;
                currentYAxisMax = myYAxis.Range.Maximum;

Any help is greatly appreciated.

Thanks,

Jeff

0 Kudos
Message 1 of 1
(2,917 Views)