Browse Source

Fix axis

pull/8/head
Florian Mounier 13 years ago
parent
commit
d565179f49
  1. 4
      out.py
  2. 4
      pygal/svg.py

4
out.py

@ -3,9 +3,9 @@ from pygal import Line, Bar, XY, Pie, StackedBar, Config
from math import cos, sin
bar = Bar()
rng = [-3, -32, -39]
rng = [6, 19]
bar.add('test1', rng)
bar.add('test2', map(abs, rng))
# bar.add('test2', map(abs, rng))
bar.x_labels = map(str, rng)
bar.title = "Bar test"
with open('out-bar.svg', 'w') as f:

4
pygal/svg.py

@ -90,7 +90,6 @@ class Svg(object):
for label, position in labels:
guides = self.node(axis, class_='guides')
x = self.view.x(position)
if x != 0:
self.node(guides, 'path',
d='M%f %f v%f' % (x, 0, self.view.height),
class_='%sline' % (
@ -103,7 +102,7 @@ class Svg(object):
return
axis = self.node(self.plot, class_="axis y")
# import pdb; pdb.set_trace()
if 0 not in [label[1] for label in labels]:
self.node(axis, 'path',
d='M%f %f h%f' % (0, self.view.height, self.view.width),
@ -111,7 +110,6 @@ class Svg(object):
for label, position in labels:
guides = self.node(axis, class_='guides')
y = self.view.y(position)
if y != self.view.height:
self.node(guides, 'path',
d='M%f %f h%f' % (0, y, self.view.width),
class_='%sline' % (

Loading…
Cancel
Save