LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Graph X-axis Dates manipulation

Solved!
Go to solution

Hi All,

I have a XY graph with two arrays one on the Y-axis for Int values and another one in the X-axis for dates (formatted as TimeStamp). The range for the dates are set automatically, I want to be able to set it to an specific time frame. For example, i want the graph to show just one year back from today's date. ie: 2/27/2017 as minimum and 2/27/2018 as maximum. The problem is that on the property window to scale the Time-axis is set to scientific notation numbers. Anyone knows how to manipulate to display specific dates? I have to do it programatically so it changes everyday. 

0 Kudos
Message 1 of 3
(2,625 Views)
Solution
Accepted by topic author dreamheart

Do this:

 

 

xy chart range.png

 

The giant numbers you're seeing are the date format used by LabVIEW- it's the number of seconds since January 1st, 1903. You can set the min and max to (1 year ago, today) like this:

 

graph 1 yr.png

 

Set the Max to Today (via the Get Date/Time in Seconds function), then subtract 1 year worth of seconds and set that to the minimum. You'll probably want to set your increment to something that makes sense as well (maybe one month's worth of seconds?)

 

Message 2 of 3
(2,606 Views)

Thanks a lot!!! I would've never imagined that was the seconds passed since 1903......that's crazy! thanks again!! 🙂

0 Kudos
Message 3 of 3
(2,543 Views)