Merge branch 'master' of git.hjp.at:hjp/timeseries
This commit is contained in:
commit
0d47dee3cd
|
@ -616,11 +616,27 @@ sub get_ticks {
|
|||
$nexttime = sub { return $_[0] + 60 };
|
||||
}
|
||||
|
||||
my $time = $firsttime;
|
||||
my $time = $nexttime->($firsttime);
|
||||
my $llb;
|
||||
for (;;) {
|
||||
push @ticks, [$time, strftime($label, localtime($time))];
|
||||
my $lb = strftime($label, localtime($time));
|
||||
my $dlb = $lb;
|
||||
if ($llb) {
|
||||
my @lc = split(/(\d+)/, $llb);
|
||||
my @c = split(/(\d+)/, $lb);
|
||||
for my $i (0 .. $#c) {
|
||||
if ($c[$i] eq $lc[$i]) {
|
||||
$c[$i] = " " x length($c[$i]);
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
$dlb = join("", @c);
|
||||
}
|
||||
push @ticks, [$time, $dlb];
|
||||
if ($time > $lasttime) {last}
|
||||
$time = $nexttime->($time);
|
||||
$llb = $lb;
|
||||
}
|
||||
|
||||
return @ticks;
|
||||
|
|
Loading…
Reference in New Issue