Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert relative time scale in Visual C# 08

Solved!
Go to solution

I am writing an application using Visual Studio 08 with measurement studio.

I want to use relative time scale on my X axis

 

I have tried using

graph.XAxes[0].MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "%<%H:%M:%S>t");

Doesnt work.

Can someone help me with this?

0 Kudos
Message 1 of 7
(5,080 Views)

Hi Pankil,

 

It looks like you are close, but try using this formatting string "h:mm:ss tt":

 

 

graph.XAxes[0].MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "h:mm:ss tt");

 This line worked in an example program I modified, but let me know if you are still havingproblems in your code.


 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 7
(5,064 Views)

Nope didnt help

Ive attached a pic of what I get with this change.

0 Kudos
Message 3 of 7
(5,062 Views)

oops..! here is the image.

 

RelativeTimeScaleBug.JPG

0 Kudos
Message 4 of 7
(5,061 Views)

Hi Pankil,

 

It looks like the time stamps are showing up, the problem is just related to a scaling issue.  To fix this, make sure you are properly converting your time axis to the proper range using xAxis.Range.  If you are having trouble finding the correct values, please let me know how many data points you are plotting and what range you are using. 

 

 

 

 

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 5 of 7
(5,033 Views)

Hi,

I am using 5400 data points(90 min run)

 

I use (DateTime.Now - DateTimeStart).TotalSeconds for xaxis.

 

0 Kudos
Message 6 of 7
(5,029 Views)
Solution
Accepted by topic author pankil

Hello Al B,

I did figure out solution for the issue

 

Using %H:mm:s or H:mm:s both work.

 

Could you elaborate what difference should '%' normally make?

0 Kudos
Message 7 of 7
(5,007 Views)