08-18-2008 04:28 AM
In a previous version of Measurement Studio (VB6) I used the wavegraph to plot xy data with a negative timestamp (x axis). This was very usefull to show values before and after a trigger point and to set the timevalue of the trigger point to zero.
Now I try to convert these program to a .NET assembly but I haven't found a way to show negative values in time formated x axis labels. If I switch the Label format to DateTime an ArgumentOutOfRangeException is thrown. But it is very urgend to show the time difference between the plotted values and the trigger in a time format.
What can I do to get the same solution like before?
Rainer
08-27-2008 02:27 AM
Hi Rainer,
Kristen Cippant from our team in Austin provided an example on how to do this in our internal forums. I attached the project. Here is what she added as comments:
"So, what I had to do was inherit from FormatStringMode and create my own string mode that I called NegativeDateTimeFormatString. I had set the mode to be Numeric instead of DateTime to avoid all the ArgumentOutOfRange exceptions. I overrode the FormatDouble function so that it formats the data as a DateTime then converts it to a string to be displayed on the graph. I get around the exceptions here by getting the absolute value of the number first if it is negative, converting to DateTime, then to String, and then appending the '-' back on the front."
I hope you can use this as a replacement for your current solution.
Best regards,
Peter
08-27-2008 07:20 AM
Hi Peter,
Thanx for your (and Kirstens) help, the solution works very good.
That's what I was looking for.
Thank you
Rainer
03-13-2009 09:52 AM
I have been looking for this for a while. Is it possible to do this using WaveFormGraph as well? Not just a scatter Graph? In WaveFormGraph, I have to use either DateTime (which can not be set negative) or samples on the x-axis.
I have been working on this project for a while så it would be a lot of work to leave WaveFormGraph behind now.
Waiting eagerly for response.
-per helge