X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/2e1670a821ac2582ac8c65f3ec39bfa64d27577a..2d3dc86d07a7ebf5f638084259ae2d9c2c63e6b6:/IkiWiki/Plugin/postsparkline.pm?ds=inline diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index 6f7558bc4..9e885741e 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -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 ($@) {