Browse Source

Fix IndexError in `svg.charts.plot.Plot.field_size` when there are only two values returned by float_range (in the case there are only two different 'y' values in the data) and scale_y_integers == True. Credit to Jean Schurger <http://schurger.org/>_ for the patch.

pull/8/head
jaraco 15 years ago
parent
commit
c0dd785bab
  1. 11
      readme.txt
  2. 3
      svg/charts/plot.py

11
readme.txt

@ -50,6 +50,17 @@ More To-Dos
Changes Changes
------- -------
2.0.3
~~~~~
* Fix IndexError in ``svg.charts.plot.Plot.field_size`` when there are
only two values returned by float_range (in the case there are only
two different 'y' values in the data) and scale_y_integers == True.
Credit to `Jean Schurger <http://schurger.org/>`_ for the patch.
* Fixed problem in setup.py installing on Unix OS (case sensitivity of
readme.txt). Credit to Luke Miller and Jean Schurger for supplying
a patch for this issue.
2.0.2 2.0.2
~~~~~ ~~~~~

3
svg/charts/plot.py

@ -215,7 +215,8 @@ class Plot(Graph):
side = {'x': 'right', 'y': 'top'}[axis] side = {'x': 'right', 'y': 'top'}[axis]
values = getattr(self, 'get_%s_values' % axis)() values = getattr(self, 'get_%s_values' % axis)()
max_d = self.data_max(axis) max_d = self.data_max(axis)
dx = float(max_d - values[-1]) / (values[-1] - values[-2]) dx = len(values) > 1 and float(max_d - values[-1]) / \
(values[-1] - values[-2]) or max_d
graph_size = getattr(self, 'graph_%s' % size) graph_size = getattr(self, 'graph_%s' % size)
side_font = getattr(self, '%s_font' % side) side_font = getattr(self, '%s_font' % side)
side_align = getattr(self, '%s_align' % side) side_align = getattr(self, '%s_align' % side)

Loading…
Cancel
Save