NI Home > Community > NI Discussion Forums
Reply
Member
jble
Posts: 24
0 Kudos

EditRangeDateTimeFormatMode used for... ?

In my IntensityGraph, the YAxis has two properties: EditRangeNumericFormatMode, and EditRangeDateTimeFormatMode. Presumably this means I should be able to set my axis to display either time format or numeric format, and use these properties to control the details of how those are displayed. Problem is, I can't figure out how to setup the axis to display time. All the plot and axes properties seem to support numeric value but not time value. How do I get the IntensityGraph to display an axis as time value?  Thanks.

Member vcp
Member
vcp
Posts: 87
0 Kudos

Re: EditRangeDateTimeFormatMode used for... ?

Hi there,

 

To display time on the scale/axes you need to set the LabelFormat to appropriate value.

The following code snippet should be clear to make you understand how to do it.

 

intensityXAxis1.MajorDivisions.LabelFormat = new FormatString(FormatStringMode.DateTime, "G");

Regards

 

Vijet Patankar

National Instruments

Member
jble
Posts: 24
0 Kudos

Re: EditRangeDateTimeFormatMode used for... ?

[ Edited ]

OK, thanks. I guess the reason I missed this is that the VS properties editor does not give you the option of configuring date/time format from the GUI. So, configuring it via line of C# code is the only option. It would be good to mention this in the documentation for EditRangeDateTimeFormatMode.

Member vcp
Member
vcp
Posts: 87
0 Kudos

Re: EditRangeDateTimeFormatMode used for... ?

Hi there,

 

You can set the LabelFormat property in different ways at design time.

 

Method1)

 

change label format2.png

 

Method2)

 

change label format.png

 

Regards,

 

Vijet Patankar

National Instruments

Member
jble
Posts: 24
0 Kudos

Re: EditRangeDateTimeFormatMode used for... ?

Thanks. But my point is, I did not see Date/Time type of option in the list.

Member
jble
Posts: 24
0 Kudos

Re: EditRangeDateTimeFormatMode used for... ?

Never mind - I did not notice the 'Category' header at the top. Thanks!