Help: Get time&date on the x-axis.
Brought to you by:
ghowlett
Hi George,
I'm new to Tcl/Tk and BLT for that matter. I would like
some help in being able to get the x-axis to have a Date
and Time vaule. I'm after a result that would have the
time in hourly increments and the date for that time
below. eg time and date for the x-axis
00:00 06:00 12:00 18:00 00:00 06:00
21/06/2002 22/06/2002
Hope you can understand what I mean above.
The value that I would use to calculate the time& date
would be in the form of 'clock seconds'.
I would think that somebody would have done something
like this in the past, but I don't seem to be able to track
anything down on the Web.
Thanks for any assistance.
Andrew
Logged In: YES
user_id=3009
The way I did this was to use a custom label formatter like
so ->
proc time_axis_fmt {w t} {
global state;
set ttime [expr int($t * $state(binsize) +
$state(fromsec1))];
return [clock format $ttime -format "%H:%M, %d %b" -gmt 1];
}
...
graph $state(graphframe).g;
$state(graphframe).g xaxis configure -command
time_axis_fmt -title "Time (UTC)" -subdivisions 0;
...