From 2db9b0f4324f95ed271879d8d09e13e14304e158 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Wed, 16 Dec 2009 08:33:22 +0000 Subject: [PATCH] Issue #123: Charts don't show when there's a large volume of data due to Google constraints. --- CHANGELOG | 3 +++ lib.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ebbd1d2b..5b9e7ee8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,3 +23,6 @@ sugestion. 2009-12-16 r144 Issue #122 - Infinite loop when most recent ticket was opened in December. Thanks to Chris Vigelius for the report. + +2009-12-16 r145 issue #123 - Google Chart doesn't show when there is a large +volume of data in the system. This patch restricts the chart to 1000px wide. diff --git a/lib.py b/lib.py index 2e43c0a6..5906eb97 100644 --- a/lib.py +++ b/lib.py @@ -145,7 +145,7 @@ def line_chart(data): # Set width to '65px * number of months + 100 for headings.'. - chart_url = 'http://chart.apis.google.com/chart?cht=lc&chs=%sx150&chd=t:' % (len(column_headings)*65+100) + chart_url = 'http://chart.apis.google.com/chart?cht=lc&chs=%sx150&chd=t:' % (min(len(column_headings)*65+100, 1000)) first_row = True row_headings = [] for row in data[1:]: @@ -190,7 +190,7 @@ def bar_chart(data): # Set width to '220px * number of months'. - chart_url = 'http://chart.apis.google.com/chart?cht=bvg&chs=%sx150&chd=t:' % (len(column_headings) * 220) + chart_url = 'http://chart.apis.google.com/chart?cht=bvg&chs=%sx150&chd=t:' % (min(len(column_headings) * 220, 1000)) first_row = True row_headings = [] for row in data[1:]: