if ($@) {
return "[[postsparkline error $@]]";
}
+
+ if (! @data) {
+ # generate an empty graph
+ push @data, 0 foreach 1..($params{max} / 2);
+ }
+
+ my $color=exists $params{color} ? "($params{color})" : "";
+
delete $params{pages};
delete $params{formula};
delete $params{ftime};
+ delete $params{color};
return IkiWiki::Plugin::sparkline::preprocess(%params,
- map { $_ => "" } reverse @data);
+ map { $_.$color => "" } reverse @data);
} # }}}
sub perfoo ($@) {