From 5f431edab9f5fda319db3c1446fde87e6a33dd30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Fri, 23 Nov 2012 10:10:04 +0100 Subject: [PATCH] limit bar charts to 100% length --- mygpo/web/templatetags/charts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mygpo/web/templatetags/charts.py b/mygpo/web/templatetags/charts.py index baa78aa3..49378817 100644 --- a/mygpo/web/templatetags/charts.py +++ b/mygpo/web/templatetags/charts.py @@ -17,7 +17,7 @@ def vertical_bar(value, max_value, display=None): else: value_str = str(value) - ratio = float(value) / float(max_value) * 100 + ratio = min(float(value) / float(max_value), 1) * 100 if ratio > 40: left, right = ''+ value_str +'', '' else: -- 2.11.4.GIT