From 7a23eaec1bce144ad38683f19373754a747416c8 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 17 Jul 2019 15:51:05 +0800 Subject: [PATCH] [Fix] bug in set price range --- vnpy/chart/item.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vnpy/chart/item.py b/vnpy/chart/item.py index 196b0606..a1937456 100644 --- a/vnpy/chart/item.py +++ b/vnpy/chart/item.py @@ -89,14 +89,15 @@ class ChartItem(pg.GraphicsObject): This function is called by external QGraphicsView. """ rect = opt.exposedRect + min_ix = int(rect.left()) max_ix = int(rect.right()) max_ix = min(max_ix, len(self._bar_picutures)) + self._draw_item_picture(min_ix, max_ix) - self._draw__item_picuture(min_ix, max_ix) self._item_picuture.play(painter) - def _draw__item_picuture(self, min_ix: int, max_ix: int) -> None: + def _draw_item_picture(self, min_ix: int, max_ix: int) -> None: """ Draw the picture of item in specific range. """ @@ -179,7 +180,7 @@ class CandleItem(ChartItem): min_price, max_price = self._manager.get_price_range() rect = QtCore.QRectF( 0, - max_price, + min_price, len(self._bar_picutures), max_price - min_price )