]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/postsparkline.pm
Move about: fix to version 2.31.3 in the changelog
[git.ikiwiki.info.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 ($@) {