Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

ScatterGraph DateTime x-axis format - ArgumentOutOfRangeException when zoom/pan <0

Solved!
Go to solution

I'm using the ScatterGraph control formatting with an x-axis format mode of DateTime. When I pan or zoom so that the visible range is <0 I a DateTime ArgumentOutOfRangeException is thrown from the main app. How can I handle this? Or alternatively how can I set the ScatterGraph to ignore calls to pan/zoom out of range?

 

To easily reproduce the exception you can use the PlotDateTime example (C😕Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\DotNET\Examples\UI\WindowsForms\Graph\PlotDateTime\cs\PlotDateTime.2008.sln).

 

1. Change MainForm.cs

    from:

    private DateTime startDate = DateTime.Now;

    to:

    private DateTime startDate = DateTime.MinValue;

2. Build and Run.

3. Click Chart Data.

4. Click Stop Charting.

5. Use the shift-left drag to pan left.

6. Boom!


Using Measurement Studio 8.6 for Visual Studio 2008 on WinXP SP2 with .NET 3.5

0 Kudos
Message 1 of 2
(4,660 Views)
Solution
Accepted by topic author furmar

Hey Furmar,

 

You can catch and handle this issue in the RangeChanged event of the axis in question.  Check out the end of this forum I answered a little while ago for more information.

 

Let me know if you still have any questions!

 

NickB

National Instruments 

Message 2 of 2
(4,656 Views)