LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph control - axis increment and date time interaction problems

Hello,

 

I'm trying to display some data in a Graph Control 

My X axis was formatted to  %<%d.%m.%Y>T and my data was also on a per Day basis, but somehow my data did not align to the Axis Scale.

 

In a further inspection i added time to my axis    %<%d.%m.%Y - %H.%M>T

and realized my scale increments are not fixed to 00:00 but 23:00.

I'm sure this is related to me being in GMT +1 and LabVIEW absolute Date time

In an attempt to fix it I forced my x-axis min and max to 00:00 and the Increment to 1 Day (86400 seconds) but the scale remains at 23:00 ^^ 

 

PaulPascher_0-1669366315378.png

 

PaulPascher_1-1669366363410.png

Is there an easy configuration to force The XAxis.Scale increments to 00:00?

 

 

0 Kudos
Message 1 of 4
(1,587 Views)

If you've been reading the Forums regularly, you'll know that putting pictures of parts of a LabVIEW VI are almost useless to getting helpful information from other readers.  Here are some questions that come to mind immediately:

  • You mention a "Graph Control".  Is it a Waveform Chart?  A Waveform Graph?  An X-Y Graph?
  • What is being plotted?  Is it a Waveform?  Is it a 1D Array of Dbl?  A 2D Array of Dbl?
  • What have you set as the scaling on the X Axis?

It is not difficult to create either a Waveform Chart or a Waveform Graph whose X Axis has Time expressed in hours, 0 to 24.00.  But I'm uncertain that this is what you are looking for ...

Chart, Graph with Time as Hours.pngBob Schor


0 Kudos
Message 2 of 4
(1,525 Views)

@Bob_Schor wrote:
  • You mention a "Graph Control".  Is it a Waveform Chart?  A Waveform Graph?  An X-Y Graph?


If you think it matters. I'm looking for a solution that can handle all of them.

 


@Bob_Schor wrote:
  • What is being plotted?  Is it a Waveform?  Is it a 1D Array of Dbl?  A 2D Array of Dbl?


Mostly a 2D array of Dbl, but obviously I'm looking for a solution that can handle all of these types.

 


@Bob_Schor wrote:
  • What have you set as the scaling on the X Axis?


I'm sure I've mentioned it, but just to make it clear, I added a minimal vi that shows it in code. 

 

As a temporary workaround, I set all markers manually, but this is a total mess since it varies from graph size. X-axis range and localization format of the x-axis data. I also would like to reuse the same graph control for multiple formats, which I do not want to provide with manual markers, which is impossible in this workaround.

 

Rephrasing of the Question:
I  want my X axis markers and scale ticks Fixed to Midnight or any other time. The provided example has its first and last Scale set to 1 AM, but all scales in between are 11PM. Which gets really confusing since the scale of 11 PM is close to my 1 AM data but shows different days ...

 

PS:

If I set x Axis Range to 00:00 and all my Data to 00:00 it doesn't fix anything. The auto markers stay at 11 PM, 

0 Kudos
Message 3 of 4
(1,511 Views)

Thank you for providing more (and more-useful) information.  LabVIEW provides "Time" as a data type (like Integer, Dbl, Boolean, etc.).  It is much easier to work with plots of data-taken-over-time when Time is explicitly bound with the data.  

 

I made an XY Graph of your data.  I set the X Axis to display "Absolute Time" and set the X Scale Minimum to the Time Stamp corresponding to Time 0000 (24-hour clock, so midnight), 28 Oct 2022, with the Maximum set 30 days later (I actually multiplied 30 x 86400 and added it to the Minimum).  Here's what I got:

Pascher XY Graph.png

Everything looks good until November 6, when we seem to lose an hour on the plot.  Why?  I think I know the answer -- at 3 am, 5 Nov 2022, the US switched to Standard Time, so a difference of 24 hours from midnight, 5 Nov would be 11 pm, 6 Nov.

 

See what happens on your end when you duplicate the steps I took.  Note that if you are in Europe, the date from Standard to Daylight time is (I believe) on 30 October.

 

Bob Schor

 

 

 

0 Kudos
Message 4 of 4
(1,491 Views)