Browse Source

Fix for issue with issue with x axis labels on time series plot (and probably others).

pull/8/head
Jason R. Coombs 14 years ago
parent
commit
7f6bccc659
  1. 6
      svg/charts/plot.py

6
svg/charts/plot.py

@ -217,8 +217,10 @@ 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 = len(values) > 1 and float(max_d - values[-1]) / \ dx = (
(values[-1] - values[-2]) or max_d float(max_d - values[-1]) / (values[-1] - values[-2])
if len(values) > 1 else 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