Example Programs

Showing results for 
Search instead for 
Did you mean: 

Zoom and Scroll Two Graphs Simultaneously



This program allows you to zoom and scroll two graphs simultaneously.



This program displays two scatter graph plots on the user interface, and allows the user to zoom and scroll either graph, while having the other graph zoom and scroll automatically to the same x- and y-axis values.

This is implemented using the AfterDrawPlot event which is generated each time a graph is redrawn.  When one graph changes its plot, the program checks its new x- and y-axis values and updates the other graph accordingly.

NOTE: Scrolling can be done by holding down the Ctrl key and dragging the cursor along the graph.  Zooming can be done by holding down the Shift key and clicking and dragging a selection of the graph to zoom in on.



  • Visual Studio 2012 (or compatible)
  • Measurement Studio 2013 (or compatible)


Steps to Implement or Execute Code

  1. Open LinkTwoGraphs.sln.
  2. In Form1.cs look for the "//TODO" comment and change how the data is populated to plot your own data.


 **This document has been updated to meet the current required format for the NI Code Exchange. **