]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/postsparkline.pm
truncate recentchangesdiffs after 200 lines
[ikiwiki.git] / IkiWiki / Plugin / postsparkline.pm
index 6f7558bc44d2375afcfb3a6a38a7680fe3ffbb1b..9e885741e073bc4ded2e3947366ea6265d8249db 100644 (file)
@@ -55,11 +55,20 @@ sub preprocess (@) { #{{{
        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 ($@) {