Andreschrosa Posted February 10, 2009 Share Posted February 10, 2009 I'm creating graph traces consisting of variables selected from the MySQL database, including time. Problem is, time is displaying as seconds since 1970. I cant find a way to do FormatDateTime in the XExpression. Link to comment Share on other sites More sharing options...
AzeoTech Posted February 10, 2009 Share Posted February 10, 2009 Make sure the bottom axis is set for Time. You may have to create new graph, or duplicate this graph to get it to stick. Link to comment Share on other sites More sharing options...
Andreschrosa Posted February 10, 2009 Author Share Posted February 10, 2009 What I mean is I'm using result.TheTime (selected from SQL) in the botton axe, I want to make a graph of past readings. I see the expression box becomes green if I type .FormatDateTime("%D/%m/%y %H:%M:%s", result.TheTime), however the time is still displayed in seconds. Link to comment Share on other sites More sharing options...
Andreschrosa Posted February 11, 2009 Author Share Posted February 11, 2009 OK, I managed to set the time of the result from SQL query like this: for(i = 0, i < numrows(data), i++) for(j = 0, j < numrows(result.thetime, j++) Execute("Result." + data[i] + ".time[" + j + "] = result.TheTime[" + j + "]") endfor endfor However, even when I add those as traces to the graph, time is still in seconds from 1970 notation.. how do you make those display as hours? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 11, 2009 Share Posted February 11, 2009 You can't specify formatting in the trace expression. You just end up a string which can't really be plotted. Your second solution of putting time into the actual result is a better choice. The X Expression then becomes Time. But once a graph gets set on outputting the X axis in seconds since 1970 notation, its hard to get it formatted back. Your best bet is to either duplicate the graph, or better yet, create a new one. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.