Permalink
Browse files

Merge remote-tracking branch 'arsatiki/master'

  • Loading branch information...
2 parents fa54663 + 00a3ebf commit c542996cf9a7a097b447e1ce5a1a6b66bdad254f @jacobian jacobian committed Mar 30, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 googlecharts/templatetags/charts.py
@@ -909,7 +909,9 @@ def num2chars(n, value_range):
def norm(n, value_range):
minvalue, maxvalue = value_range
- if minvalue >= 0:
+ if minvalue == maxvalue == 0:
+ return 0
+ elif minvalue >= 0:
return int(round(float(n) / maxvalue * 4095, 0))
elif maxvalue <= 0:
return 4095 - int(round(float(n) * 4095 / minvalue))

0 comments on commit c542996

Please sign in to comment.