From de5eb4996bbc8ab7d4263e70913de63e146d808d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Oct 2007 23:07:39 -0400 Subject: * postsparkline: Avoid a confusing error message if no pages match and instead show an empty graph. --- IkiWiki/Plugin/postsparkline.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index ac7ad9d73..dc996ae32 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -56,6 +56,11 @@ sub preprocess (@) { #{{{ return "[[postsparkline error $@]]"; } + if (! @data) { + # generate an empty graph + push @data, 0 foreach 1..$params{max}; + } + my $color=exists $params{color} ? "($params{color})" : ""; delete $params{pages}; -- cgit v1.2.3