Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError in normalizeData #2

Open
spektom opened this issue Nov 15, 2015 · 0 comments
Open

ZeroDivisionError in normalizeData #2

spektom opened this issue Nov 15, 2015 · 0 comments

Comments

@spektom
Copy link

spektom commented Nov 15, 2015

I'm getting the following exception:

  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 799, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/platypus/frames.py", line 196, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 112, in drawOn
    self._drawOn(canvas)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 93, in _drawOn
    self.draw()#this is the bit you overload
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/shapes.py", line 682, in draw
    renderPDF.draw(self, self.canv, 0, 0, showBoundary=showBoundary)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderPDF.py", line 29, in draw
    R.draw(renderScaledDrawing(drawing), canvas, x, y, showBoundary=showBoundary)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderbase.py", line 199, in draw
    self.drawNode(drawing)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderPDF.py", line 55, in drawNode
    self.drawNodeDispatcher(node)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderbase.py", line 280, in drawNodeDispatcher
    self.drawGroup(node)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderbase.py", line 297, in drawGroup
    node = _expandUserNode(node,canvas)
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/renderbase.py", line 161, in _expandUserNode
    node = node.provideNode()
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/widgetbase.py", line 150, in provideNode
    return self.draw()
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/charts/piecharts.py", line 910, in draw
    w = self.makeWedges()
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/charts/piecharts.py", line 718, in makeWedges
    angles = self.makeAngles()
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/charts/piecharts.py", line 684, in makeAngles
    D = [a for a in enumerate(self.normalizeData(keepData=wr))]
  File "/home/spektom/.virtualenvs/dw/local/lib/python2.7/site-packages/reportlab/graphics/charts/piecharts.py", line 670, in normalizeData
    f = 360./s
ZeroDivisionError: float division by zero

I guess this piece of code from normalizeData() is problematic:

if s<=1e-8: s = 0
f = 360./s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant