=== modified file 'Koo/KooChart/GraphicsBarChartItem.py' --- Koo/KooChart/GraphicsBarChartItem.py 2009-07-01 07:58:54 +0000 +++ Koo/KooChart/GraphicsBarChartItem.py 2010-12-26 20:29:23 +0000 @@ -19,7 +19,6 @@ from PyQt4.QtGui import * from AbstractGraphicsChartItem import * - class BarChartBar(QGraphicsRectItem): def __init__(self, parent): QGraphicsRectItem.__init__(self, parent) @@ -234,17 +233,19 @@ else: height = abs( ( (value-minimum) / diff ) * maximumHeight ) # Ensure it doesn't go beyond axis due to rounding errors - height = min( max( 0.0, height ), maximumHeight ) + height = min( max( 0.0, height ), maximumHeight ) + item = BarChartBar( self ) if j < len(self._labels): item.setToolTip( '%s: %.2f' % (self._labels[j], value) ) item.setBrush( manager.brush(j) ) item.setPen( manager.pen(j) ) - if value >= 0.0: - item.setRect( lastPosition, maximumHeight - lastYPosition - height - zero, barWidth, height ) - else: - item.setRect( lastPosition, maximumHeight - lastYPosition - zero, barWidth, height ) + if value < 0.0: + # ugly hack, apparently 2 pos must by > 0 + if lastYPosition == 0.0 and height == 0.0: + height = maximumHeight * 0.001 + item.setRect( lastPosition, maximumHeight - lastYPosition - height , barWidth, height -zero ) # Hide item if height is 0. Otherwise it's shown as a single # ugly line. if height == 0.0: