projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06f43fc
)
correct gnuplot columns if timefmt has spaces
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 11 Jun 2023 10:02:10 +0000
(12:02 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 11 Jun 2023 10:02:10 +0000
(12:02 +0200)
lib/MojoFacets/Gnuplot.pm
patch
|
blob
|
history
diff --git
a/lib/MojoFacets/Gnuplot.pm
b/lib/MojoFacets/Gnuplot.pm
index
14a39ed
..
1af3cc1
100644
(file)
--- a/
lib/MojoFacets/Gnuplot.pm
+++ b/
lib/MojoFacets/Gnuplot.pm
@@
-32,10
+32,16
@@
sub index {
if ( -e "$dir/$url" ) {
+ my $timefmt = $self->param('timefmt');
+
+ my $spaces = $timefmt;
+ $spaces =~ s/\S//g;
+ $spaces = length( $spaces );
+
my @plot;
foreach ( 1 .. $#$columns ) {
my $title = $columns->[$_];
- my $n = $_ + 1;
+ my $n = $_ + 1
+ $spaces
;
push @plot, qq|"$dir/$url" using 1:$n title "$title" with $with| unless $hide_columns->{ $title };
}
@@
-46,7
+52,7
@@
set output '$dir/$url.png'
|;
- if (
my $timefmt = $self->param('timefmt')
) {
+ if (
$timefmt
) {
$g .= qq|
set xdata time